-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
How do I encode an enum in circe style? #1014
Comments
Hi, Arne! Thanks for your feedback again! There are a couple of special macros for derivation of codecs that are compatible with circe: But currently they do not work properly with Scala objects. I'm going to fix it and cut a new release ASAP. Using those macros should help you to avoid unexpected compilation errors that are described in the 2nd item of the Know Issues list: https://github.com/plokhotnyuk/jsoniter-scala#known-issues |
Thanks a lot, this really helps. |
Currently I have an enum that is stored in the database like this
{"EnumValue":{}}
instead of"EnumValue"
or{"type":"EnumValue"}
. This style comes from circe serialization. Is there an easy option to get this style of serilization with jsoniter as well? I know by now how I can write my own custom serializer, but maybe there is an easier way to make this happen by default with more types.I have another small question. I've tried several times to call
JsoniterCodecMaker.make[MyType](myConfig)
, the function does exist, but I get weird compilation errors about compilation that I don't understand. I didn't figure out yet how to actually pass a config tomake
. Is there an explanation for that?The text was updated successfully, but these errors were encountered: