After #5254 was fixed and merged, when using Jackson, arrays with uniqueItems=true gets deserialized to HashSet rather than LinkedHashSet, thus not preserving order as expected.
Even though the field (myProp) is initialized to an empty LinkedHashSet, it is promptly overwritten with a regular HashSet given that there is no deserialization-hint (@JsonDeserialize(as = LinkedHashSet.class)) on the setMyProp-method. The method invoked looks like this:
@JsonProperty(JSON_PROPERTY_MY_PROP)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setMyProp(Set<SomeEnum> myProp) {
this.myProp = myProp;
}
and thus there is no way for Jackson to understand that order needs to be preserved.
This issue is present in version 5.2.1
After #5254 was fixed and merged, when using Jackson, arrays with uniqueItems=true gets deserialized to HashSet rather than LinkedHashSet, thus not preserving order as expected.
Even though the field (myProp) is initialized to an empty LinkedHashSet, it is promptly overwritten with a regular HashSet given that there is no deserialization-hint (@JsonDeserialize(as = LinkedHashSet.class)) on the setMyProp-method. The method invoked looks like this:
and thus there is no way for Jackson to understand that order needs to be preserved.
This issue is present in version 5.2.1