forked from loafle/openapi-generator-original
Disable Jackson FAIL_ON_INVALID_SUBTYPE in feign (#5597)
* Disable Jackson FAIL_ON_INVALID_SUBTYPE in feign With this change, Jackson does not fail even if it doesn't recognize a discriminator type name. This is helpful when upgrading a microservice with a new subtype while keeping compatibility with its old clients. The instance is returned as null instead of throwing an exception deep in the feign framework, allowing clients to gracefully degrade. * Disable FAIL_ON_INVALID_SUBTYPE for all Jackson-based projects
This commit is contained in:
committed by
wing328
parent
de427297ec
commit
be3cfda3ce
@@ -132,6 +132,7 @@ public class ApiClient {
|
||||
objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
|
||||
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
||||
objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE);
|
||||
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
objectMapper.setDateFormat(new RFC3339DateFormat());
|
||||
objectMapper.registerModule(new JodaModule());
|
||||
|
||||
Reference in New Issue
Block a user