[Java] Add a new additional property to configure Jackson's failOnUnknownProperties (#19271)

* [Java] Add a new additional property to configure Jackson's `failOnUnknownProperties`

* Move `FAIL_ON_UNKNOWN_PROPERTIES` property to JavaClientCodegen

* Template `FAIL_ON_UNKNOWN_PROPERTIES` for other libraries beside retrofit2

* Default `failOnUnknownProperties` to false for all Java Client libraries

* Fix integration tests

Add the `failOnUnknownProperties: true` additional properties to generate the
expected mapper
This commit is contained in:
Eric
2024-08-29 07:25:25 +02:00
committed by GitHub
parent 082382cc1e
commit dfc381c22f
30 changed files with 59 additions and 21 deletions

View File

@@ -34,7 +34,7 @@ public class JSON {
mapper = JsonMapper.builder()
.serializationInclusion(JsonInclude.Include.NON_NULL)
.disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE)
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING)