On Sun, Aug 12, 2018 at 7:37 AM, Moses Nakamura <[email protected]> wrote: > Hey, > I'm upgrading to 2.9.6 from 2.8.4, and I've run into a snag. It seems like > jackson used to fail to deserialize "" and throw an exception, but now it is > happy to deserialize it as null. I can try to update all of the callsites > where we were relying on the previous behavior to check whether it's trying > to deserialize "", but I'm worried I'll miss a case. Is there an option I > can enable or disable on an ObjectMapper to get back to the old behavior?
I think I'd need to see a test case for specific type(s) in question, since there is no general type-agnostic handling of empty String. But it is possible that changes to specific deserializers has expanded acceptable values, especially for scalar JDK types. One setting that could be relevant, and was added in 2.9 is MapperFeature.ALLOW_COERCION_OF_SCALARS which defaults to `true` for backwards compatibility. If you do not want such coercions you probably want to disable it, and it should also block coercion from Empty String. -+ Tatu +- -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
