Closed anqit closed 2 months ago
potentially related to https://github.com/zio/zio-schema/issues/668 ?
/bounty $100
/attempt #697
with your implementation plan/claim #697
in the PR body to claim the bountyThank you for contributing to zio/zio-schema!
Add a bounty ā¢ Share on socials
Attempt | Started (GMT+0) | Solution |
---|---|---|
š¢ @pablf | #707 |
I'm guessing an assigned bounty means that what I'm trying to do is indeed unsupported at this time? I was hoping I was just doing something wrong...
š” @pablf submitted a pull request that claims the bounty. You can visit your bounty board to reward.
šš @pablf has been awarded $100! šš
I'm trying to use
zio-schema
withzio-http
to de/serialize request/responseBody
s. I have a sealed trait representing the response body of my API, and two implementors of that trait, both of which are enums, representing success bodies (with a"data"
field) and failure bodies (with a"message"
field), but cannot seem to generate a schema for this structure. The below scala-cli script is a minimal representation of what I've tried. This compiles but fails at runtime with aClassCastException
:The full error is
Am I just doing this incorrectly or is this something not supported?