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
Option serialization regression in 2.7.2 #240
Comments
I do think that I might need a sample project to understand this issue better if you don't mind. I made changes to Option for 2.7.3 if you would also like to try the SNAPSHOT. |
I've run into the same issue with 2.7.3. Here's the repro repo: |
Not sure if this is related. I just put the following codes in the same file: package foo
import com.fasterxml.jackson.annotation.JsonTypeInfo
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
include = JsonTypeInfo.As.PROPERTY,
property = "@class")
trait Parent
case class Child(string: String) extends Parent
case class OptionWrapper(obj: Option[Parent])
object Foo extends App {
val mapper = new ObjectMapper() with ScalaObjectMapper {}.registerModule(DefaultScalaModule)
val json = mapper.writeValueAsString(new OptionWrapper(Some(Child("this is a string"))))
println(json)
} For 2.7.3, it outputs For 2.6.5, it outputs the correct result: |
@nbauernfeind Any comment on this issue? I provided a bare bones repro repo above. |
I face the same in 2.7.4 |
@brharrington's fix #271 works for me. Anyway, I found that:
|
I faced with some weird regression in 2.7.2 (in 2.6.5 all is fine).
Suppose you have this kind of data structure:
and you have some script like this:
Until you place all of this in one sbt module all will be fine. But try to place the data structure in one dependent module and the script in the other module that depends on the first one and you will get "{m:{}}" as a result of serialization (so the type information is missed).
I can create sample project showing this behavior if you wish.
The text was updated successfully, but these errors were encountered: