Skip to content
This repository has been archived by the owner on Nov 28, 2017. It is now read-only.

Support renaming fields #2

Open
casualjim opened this issue Jun 1, 2014 · 4 comments
Open

Support renaming fields #2

casualjim opened this issue Jun 1, 2014 · 4 comments
Milestone

Comments

@casualjim
Copy link
Member

Currently there is no way to override field names.

Should this be implemented with an implicit context or through annotations that look the same as the ones in Jackson and JAXB

@mkubala
Copy link
Member

mkubala commented Jun 5, 2014

I'm not sure if this solution based on annotation is a good idea - what in case when we would like to serialize an object of 3rd party class?

@casualjim
Copy link
Member Author

you raise a very good point. So we should provide a type of implicit formats but that works with macros?

@mkubala
Copy link
Member

mkubala commented Jun 5, 2014

I haven't any experience with macros yet. But because implicits are resolved also at compile time, typeclasses may work..

We need to verify such possibility.

@casualjim
Copy link
Member Author

I've got quite a bit working with macros. but things like typehints, renaming fields etc not yet.
We can resolve implicits at compile time with macros, like here:
https://github.com/json4s/muster/blob/master/core/src/main/scala/muster/consumer.scala#L197

This already leverages the type class pattern for doing it. What I'm proposing here is extra stuff to not have to write a full custom serializer (typeclass) but instead get some of those convenience things in another type of context object or something. Maybe it's too much I don't really know :)

@casualjim casualjim added this to the 0.4.0 milestone Jul 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants