Spring boot -3.3.1 Jackson -2.17.1
Comment From: wilkinsona
This issue is unactionable in its current form. Please read https://github.com/spring-projects/spring-boot/wiki/How-To-Get-Help and update or close the issue as appropriate.
Comment From: anand188
@wilkinsona
An Bean with primary is defined in the project like below
@Bean
@Primary
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
mapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.PUBLIC_ONLY);
mapper.setVisibility(PropertyAccessor.IS_GETTER, JsonAutoDetect.Visibility.PUBLIC_ONLY);
mapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.PUBLIC_ONLY);
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(SerializationFeature.FAIL_ON_UNWRAPPED_TYPE_IDENTIFIERS, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
mapper.configure(SerializationFeature.WRITE_DATES_WITH_ZONE_ID, true);
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"));
mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false);
mapper.registerModule(new WithSchemaTypeModule());
return mapper;
}
Still getting failed on unknown properties issues and the date field is number instead of the setformat , this is happens on REST API exposed in jaxrs-jersey .Also the Provider is registered in jaxrs with the ObjectMapper on startup. But in runtime the ObjectMapper seems to be somewhat different irrespective what is configured?
Comment From: wilkinsona
If you haven't already done so, please read https://github.com/spring-projects/spring-boot/wiki/How-To-Get-Help#defining-the-problem and follow its recommended steps for reproducing the problem as minimally as possible. Once you've done that, you should either close this issue and ask a question on Stack Overflow using the reproducer or, if you're confident that the problem is due to a bug in Spring Boot, you should attach the reproducer to this issue and we can take another look.
Comment From: anand188
@wilkinsona can you specify any tests run on spring boot on ObjectMapper timeformat so that i can test by changing the test code and attach it here
Comment From: wilkinsona
Sorry, we don't have time to do that. I'm going to close this issue now as it doesn't seem to be going anywhere. We can re-open it if you provide the required minimal example.