When serializing something setting JsonInclude.Include.NON_ABSENT in an objectmapper customizer the reflection free serializer doesn't check the settings when serializing null values or absent (Java 8)
Expected behavior
Reflection free serializer takes the current object mapper serialization settings when serializing values
Actual behavior
Values get serialized as null.
How to Reproduce?
Get an Quarkus quickstart with Quarkus 3.14.3 set:
@Singleton
public class RegisterObjectMapperCustomizer implements ObjectMapperCustomizer {
@Override
public void customize(ObjectMapper objectMapper) {
objectMapper
.enable(DeserializationFeature.FAIL_ON_NULL_CREATOR_PROPERTIES)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
}
}
Create one endpoint that has a return type with Optional and set the optional to empty, instead of having the field omitted, it will be there with null value
Output of uname -a or ver
No response
Output of java -version
No response
Quarkus version or git rev
3.14.3
Build tool (ie. output of mvnw --version or gradlew --version)
Describe the bug
When serializing something setting
JsonInclude.Include.NON_ABSENT
in an objectmapper customizer the reflection free serializer doesn't check the settings when serializing null values or absent (Java 8)Expected behavior
Reflection free serializer takes the current object mapper serialization settings when serializing values
Actual behavior
Values get serialized as null.
How to Reproduce?
Get an Quarkus quickstart with Quarkus 3.14.3 set:
Create an object mapper customizer:
Create one endpoint that has a return type with
Optional
and set the optional to empty, instead of having the field omitted, it will be there with null valueOutput of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.14.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response