zio-json icon indicating copy to clipboard operation
zio-json copied to clipboard

Migrate JsonEncoder/Decoder macro to Scala 3 native macro. No more magnolia

Open 987Nabil opened this issue 1 year ago • 6 comments

  • annotation handling
  • decoders for recursive data structures

987Nabil avatar Apr 12 '23 08:04 987Nabil

Still needs some refactoring. But it would be nice, if one could approve the workflows.

987Nabil avatar Apr 12 '23 08:04 987Nabil

I thought one could extract the common macro code to some helper. But this does not seem to work since the imports of the using Quotes are path dependent. So I guess this is ready for review.

987Nabil avatar Apr 14 '23 06:04 987Nabil

@987Nabil Looks great! Can you add some more tests for this under Scala 3 so we can be more assured the derivation is working correctly?

jdegoes avatar Apr 25 '23 09:04 jdegoes

There are actually a lot of shared tests. I think most cases are covered. But I can take a look if I find something missing. Do you have something particular in mind?

987Nabil avatar Apr 25 '23 10:04 987Nabil

@987Nabil Using this benchmark set you can test both correctness and performance of the new way of derivation on ~60 synthetic and real-world JSON samples.

plokhotnyuk avatar Apr 25 '23 10:04 plokhotnyuk

fyi: The benchmark does not compile. Did not find the time yet to take a deeper look.

987Nabil avatar May 14 '23 19:05 987Nabil