zio / zio-schema

Compositional, type-safe schema definitions, which enable auto-derivation of codecs and migrations.
https://zio.dev/zio-schema
Apache License 2.0
142 stars 162 forks source link

Scala 3: Enum case annotations are the parent annotations for derived schema #651

Closed 987Nabil closed 9 months ago

987Nabil commented 9 months ago

If given an enum with annotations

@description("Color Enum")
enum Color:
  @description("Red")
  case Red

The @description("Color Enum") annotation will be added to the schema derived via DeriveSchema[Color] as an annotation to the top level schema, the case Red and the schema of the Red case. While @description("Red") is nowhere to be found.

This is clearly a bug. I think the annotations for the case and the case schema should be the ones added to case Red

jdegoes commented 9 months ago

/bounty $75

algora-pbc[bot] commented 9 months ago

💎 $75 bounty created by ZIO 🙋 If you start working on this, comment /attempt #651 along with your implementation plan 👉 To claim this bounty, submit a pull request that includes the text /claim #651 somewhere in its body 📝 Before proceeding, please make sure you can receive payouts in your country 💵 Payment arrives in your account 2-5 days after the bounty is rewarded 💯 You keep 100% of the bounty award 🙏 Thank you for contributing to zio/zio-schema!

👉 Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @pablf #657
algora-pbc[bot] commented 9 months ago

💡 @pablf submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 9 months ago

🎉🎈 @pablf has been awarded $75! 🎈🎊