-
-
Notifications
You must be signed in to change notification settings - Fork 142
Description
I encountered an issue with deserializing JSON like this:
{"x": "42", "y": "foo"}Note the value of x is a valid integer, but represented as a JSON string, which is fairly common. Now, trying to deserialize this to Ints works as expected: x will be parsed as Int, and y will trigger an InvalidFormatException. However, if you try to serialize this as Option[Int], it will succeed in both cases, and you get a reference to a Some that holds a String, which caused very subtle bugs in our code.
I wanted to do a pull request, but unfortunately I was not able to build this project from a clean checkout using sbt or IntelliJ, so instead I isolated some tests to an external repository. The last two tests there are failing.
If someone would be willing to help me build jackson-module-scala and/or pair with me on fixing this, jut ping me on twitter @c089.