Replies: 1 comment 1 reply
-
|
@Dragas did u find answers to your problem? Your last statement made me hope so.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While migrating to jackson 3 I've encountered an issue where the following json block
{"set": ["DOESNT_EXIST", "DOES_EXIST"]}fails to deserialize as following java record
The gist is that jackson used to deserialize sets regardless of values they contained as hash sets if interface type was selected, which in turn permitted those sets to contain nulls for enumerated values. In jackson 3, on the other hand, this got changed and if a set containing enums is identified jackson opts to deserialize to
EnumSet<T extends Enum<T>>which doesn't permit null values. I see a note inEnumSetDeserializerconfirming this (https://github.com/FasterXML/jackson-databind/blob/jackson-databind-3.1.4/src/main/java/tools/jackson/databind/deser/jdk/EnumSetDeserializer.java#L212-L214)Is there a way to nudge jackson to retain the old behavior without having to explicitly declare that a hash set is required in such contexts?
Full reproduction code
Self nitpick: apparently
Builder#configureacceptsDatatypeFeatureas argument, which i never noticed.Beta Was this translation helpful? Give feedback.
All reactions