jsoniter-scala
jsoniter-scala copied to clipboard
Custom deserialization for single ADT field
I was thinking that something along the lines of Jackson's @JsonDeserialize annotation would be ideal. Or any way to wire up that configuration without needing to hand-write custom deserialization code for the entire ADT just to override the behaviour for one field. I haven't found any such examples in the codebase or tests and was wondering if this was possible with jsoniter-scala. Thanks!
Currently there are no ability to bind a custom codec for the class field. As W/A you can use some custom type for the field (which extends AnyVal
as example) or fix parsed by one of transformation libraries like Chimney.
@frankgrimes97 Could you please share your samples of JSON values and a type? Possible some other ideas for enchantment will be suitable for your case.