Skip to content
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

Merged
merged 10 commits into from
May 24, 2023
Merged

Scala Json Parsing #100

merged 10 commits into from
May 24, 2023

Conversation

nomisRev
Copy link
Contributor

Current state: Cannot resolve correct signature

@nomisRev
Copy link
Contributor Author

Ready for review @xebia-functional/team-ai

Copy link
Contributor

@raulraja raulraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nomisRev !

scala/src/main/scala/com/xebia/functional/auto/AI.scala Outdated Show resolved Hide resolved
tokenizer/karma.config.d/proxy-resources.js Outdated Show resolved Hide resolved
nomisRev and others added 2 commits May 24, 2023 14:38
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),
Copy link
Contributor

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 🙂

Copy link
Contributor Author

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.

Copy link
Contributor

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nomisRev !

@nomisRev
Copy link
Contributor Author

@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.

@nomisRev nomisRev merged commit e35779e into main May 24, 2023
@nomisRev nomisRev deleted the scala-json-parsing branch May 24, 2023 13:11
@Yawolf
Copy link
Contributor

Yawolf commented May 24, 2023

@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.

This PR is absolutely perfect! Thanks @nomisRev 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants