classFinatraCaseClassDeserializer extends JsonDeserializer[AnyRef] with Logging
Custom case class deserializer which overcomes limitations in jackson-scala-module.
Our improvements:
- Throw a JsonException when 'non Option' fields are missing in the incoming json
- Use default values when fields are missing in the incoming json
- Properly deserialize a Seq[Long] (see https://github.com/FasterXML/jackson-module-scala/issues/62)
- Support "wrapped values" using WrappedValue (needed since jackson-scala-module does not support @JsonCreator)
- Support for field and method level validations
NOTE: This class is inspired by Jerkson' CaseClassDeserializer which can be found here:
https://github.com/codahale/jerkson/blob/master/src/main/scala/com/codahale/jerkson/deser/CaseClassDeserializer.scala
Custom case class deserializer which overcomes limitations in jackson-scala-module.
Our improvements: - Throw a JsonException when 'non Option' fields are missing in the incoming json - Use default values when fields are missing in the incoming json - Properly deserialize a Seq[Long] (see https://github.com/FasterXML/jackson-module-scala/issues/62) - Support "wrapped values" using WrappedValue (needed since jackson-scala-module does not support @JsonCreator) - Support for field and method level validations
NOTE: This class is inspired by Jerkson' CaseClassDeserializer which can be found here: https://github.com/codahale/jerkson/blob/master/src/main/scala/com/codahale/jerkson/deser/CaseClassDeserializer.scala