Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Jackson ObjectMapper improved default properties outside spring-web [SPR-12293] #16898

Closed
spring-projects-issues opened this issue Oct 3, 2014 · 1 comment
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Sébastien Deleuze opened SPR-12293 and commented

It could be interesting to have an ObjectMapper builder outside spring-web and spring-webmvc modules (for example in messaging) in order to have the same Jackson default settings everywhere in Spring Framework. It is currently not directly possible since Jackson2ObjectMapperBuilder is in spring-web module.

Perhaps something to consider if we support in the future @JsonView in @MessageMapping annotated handler methods.

Another solution (even if less clean) could be to configure the same properties (DEFAULT_VIEW_INCLUSION and FAIL_ON_UNKNOWN_PROPERTIES to false) directly with the ObjectMapper instances in org.springframework.messaging.converter.MappingJackson2MessageConverter and org.springframework.jms.support.converter.MappingJackson2MessageConverter constructors.


Affects: 4.1.1

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

From my perspective, simply setting the same properties on those internally created ObjectMapper instances isn't bad at all. I'd favor this little bit of repetition over a convoluted dependency structure.

Juergen

@spring-projects-issues spring-projects-issues added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants