You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know it it's a feature or a bug, but after registering JaxbAnnotationModule to the ObjectMapper mapper.registerModule(new JaxbAnnotationModule());
setting PropertynamingStrategy different from LowerCamelCase mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
is definitely ignored. Only default LOWER_CAMEL_CASE works.
If I remove JaxbAnnotationModule I can successfully set different PropertyNamingStrategy.
Unfortunately I need JaxbAnnotationModule to ignore field annotated with XmlTransient in schema generation, but at the same time I have to comply to the ISO Whitepaper for 20022 UNIFI messages that forces snake_case naming convention.
Cheers
The text was updated successfully, but these errors were encountered:
Found the solution!
after adding JaxbAnnotationModule, if you still want to set propertyNamingStrategy you have to enable the MapperFeature ALLOW_EXPLICIT_PROPERTY_RENAMING.
Unfortunately I had to refactor my code since enable(MapperFeature) is deprecated on ObjectMapper. I used a subclass named JsonMapper. Here is the code.
I don't know it it's a feature or a bug, but after registering JaxbAnnotationModule to the ObjectMapper
mapper.registerModule(new JaxbAnnotationModule());
setting PropertynamingStrategy different from LowerCamelCase
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
is definitely ignored. Only default LOWER_CAMEL_CASE works.
If I remove JaxbAnnotationModule I can successfully set different PropertyNamingStrategy.
Unfortunately I need JaxbAnnotationModule to ignore field annotated with XmlTransient in schema generation, but at the same time I have to comply to the ISO Whitepaper for 20022 UNIFI messages that forces snake_case naming convention.
Cheers
The text was updated successfully, but these errors were encountered: