-
Notifications
You must be signed in to change notification settings - Fork 15
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
Scala Json Parsing #100
Scala Json Parsing #100
Conversation
Ready for review @xebia-functional/team-ai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nomisRev !
Co-authored-by: Yago Cervantes <1420230+Yawolf@users.noreply.github.com>
SerialDescriptor[A].serialDescriptor, | ||
decode[A](_).fold(throw _, identity), | ||
ScalaSerialDescriptor[A].serialDescriptor, | ||
(json) => parse(json).flatMap(Decoder[A].decodeJson(_)).fold(throw _, identity), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this, but it failed in the previous build because io.circe.parse.decoder
is needed 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I misunderstood your suggestion, but that was failing compilation. Feel free to update this to whatever you feel is most idiomatic
Decoder.decodeJson
takes a Json
and not a String
, so I used parse
first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nomisRev !
@Yawolf I am going to merge this PR, but feel free to update or propose a better more Scala idiomatic encoding in a different PR, or in a subsequent PR where we try to implement some examples. My Scala experience is extremely limited. |
Current state: Cannot resolve correct signature