-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON Decoding Issue in ZIO with Order-Dependent Parsing Failure for ADT Containing Mixed Types #711
Comments
/bounty $125 |
💎 $125 bounty • ZIOSteps to solve:
Thank you for contributing to zio/zio-schema! Add a bounty • Share on socials
|
/attempt #711 Options |
It's already solved by #710 (scastie). The reason why it failed to decode was the bug in empty object decoding rather than the order dependency. On the contrary, there's a bug where the second |
💡 @guersam submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
🎉🎈 @guersam has been awarded $125! 🎈🎊 |
Description
JSON decoding bug occurs when attempting to parse parameters following a sealed trait with mixed types (case objects and a case class). The decoder fails to process any parameters that follow the ADT parameter unless the fields in the case class containing the ADT are reordered.
Steps to Reproduce:
Minimal Code to Reproduce
Expected Behavior:
The decoder should reconstruct the
Wrapper
instance correctly, preserving the order and integrity of fields (a, b, c)Actual Behavior:
When the ADT field
c
is placed between two other fields, decoding fails for the fields that follow the ADT field. However, rearranging the fields in theWrapper
class (placing the ADT field at the end) resolves the issue.Environment:
The text was updated successfully, but these errors were encountered: