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

Boilerplate free case class serialization with implicit macros

Open jrudolph opened this issue 12 years ago • 7 comments

See discussion: https://groups.google.com/d/msg/spray-user/zTORNzACIp0/qTmDWi9TZ8EJ

Experimentation branch:

https://github.com/jrudolph/spray/tree/feature/json-case-class-implicit-macro

jrudolph avatar Jun 26 '13 11:06 jrudolph

Wrote another macro-based formatter for current version of spray-json based on your naming.

Additionally, it allows declaring other values in case classes and avoids any use of runtime reflection so #53 can be solved as well.

guersam avatar Jul 06 '13 19:07 guersam

What's left to do to get macro-based case class serialization in? Is there anything I can do to help?

zackangelo avatar Apr 09 '15 14:04 zackangelo

@zackangelo Thanks for offer to help. We currently don't have any capacity for major changes/extensions to spray-json, so we can't really say when macro-based case class support will be available. Sorry!

sirthias avatar Apr 15 '15 09:04 sirthias

@sirthias Thanks for responding! I'm sure you guys are swamped.

I went ahead and wrote a small macro library that supports my use cases (automatic formats for case classes with greater than 22 fields, field renaming, etc). I'll just leave a link here in case someone else finds it useful: https://github.com/zackangelo/spray-json-macros

Any feedback would be greatly appreciated.

zackangelo avatar Apr 16 '15 01:04 zackangelo

Great, thanks for the pointer!

sirthias avatar Apr 16 '15 07:04 sirthias

FYI https://github.com/fommil/spray-json-shapeless should solve this problem without any new macros.

fommil avatar Jul 27 '15 09:07 fommil

@sirthias btw, it is worth pointing out that Miles convinced me that Apache v2 was more appropriate for spray-json-shapeless.

fommil avatar Jul 27 '15 10:07 fommil