-
-
Notifications
You must be signed in to change notification settings - Fork 142
Cannot serialize option of anyval in a collection #277
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
Comments
As a temporary workaround I disabled anyval support in my application and to get the json to be over the wire the same I added the |
Having the same issue, is there is work around? |
@Assarin I in general moved off of anyval support for all my scala stuff. It was too problematic. I instead created this https://github.com/paradoxical-io/scala-global/tree/master/jackson/src/main/scala/io/paradoxical/jackson which is custom jackson module that knows how to serialize and deserialize tagged types using a trait: which i use like this: I found this to be easier to give me the These jars are available on maven central if you are interested |
@Assarin yet another option is to use jsoniter-scala - it has support of AnyVals with any combination of Scala collection and other types. |
I have a sample test here:
This fails with
Using jackson-core 2.7.4, jackson-databind 2.7.4, jackson-scala-module 2.7.4
Are there any workarounds to get this to work?
The text was updated successfully, but these errors were encountered: