We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I have test @JsonMerge on a scala Map. The merge doesn't work. did you work on a merge support?
The text was updated successfully, but these errors were encountered:
Can you provide a code snippet, describe what happens and what you expect to happen?
Thanks!
Sorry, something went wrong.
I have write a code sample who perform same action with Scala Map and Java Map to show differences.
import java.util import com.fasterxml.jackson.annotation.JsonMerge import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.module.scala.DefaultScalaModule import scala.collection.mutable import scala.collection.JavaConverters._ object Main extends App { class MergeJavaTest(inputMap: java.util.Map[String, String]) { @JsonMerge var map: java.util.Map[String, String] = inputMap } class MergeScalaTest(inputMap: mutable.Map[String, String]) { @JsonMerge var map: mutable.Map[String, String] = inputMap } val inputTest = """ |{ | "map": { | "foo": "test" | } |} """.stripMargin val map = mutable.Map("bar" -> "test") val existingJavaMap = new MergeJavaTest(map.asJava) val existingScalaMap = new MergeScalaTest(map) val objectMapper = new ObjectMapper().registerModule(DefaultScalaModule) val updatedJavaMap: MergeJavaTest = objectMapper.readerForUpdating(existingJavaMap).readValue(inputTest) val updatedScalaMap: MergeScalaTest = objectMapper.readerForUpdating(existingScalaMap).readValue(inputTest) println(existingJavaMap.map) // {foo=test, bar=test} println(existingScalaMap.map) // Map(foo -> test) expected Map(foo -> test, bar -> test) }
No branches or pull requests
I have test @JsonMerge on a scala Map.
The merge doesn't work.
did you work on a merge support?
The text was updated successfully, but these errors were encountered: