Skip to content

Provide ability to plug in pre-configured ObjectMapper #179

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

Closed
sammyhk opened this issue May 7, 2019 · 0 comments
Closed

Provide ability to plug in pre-configured ObjectMapper #179

sammyhk opened this issue May 7, 2019 · 0 comments
Milestone

Comments

@sammyhk
Copy link
Contributor

sammyhk commented May 7, 2019

Currently configuring ObjectMapper can be either:

  1. implement ObjectMapperConfigurer which is in decorator pattern, cannot use the existing ObjectMapper configuration used in other part of the system.
  2. implement ObjectMapperProvider to create/ re-use existing ObjectMapper configuration, but this way may have code coupling on ConfiguringObjectMapperProvider because current implementation some configuration is hard-coded in ConfiguringObjectMapperProvider (https://github.com/graphql-java-kickstart/graphql-java-servlet/blob/master/src/main/java/graphql/servlet/ConfiguringObjectMapperProvider.java#L22-L28), new implementation need to duplicate those code in order to make it work (e.g. issue Avoid explicitly inject ObjectMapper to the ObjectMapper #177)

Suggested improvement:

  1. move those hard-coded configuration in ConfiguringObjectMapperProvider to DefaultObjectMapperConfigurer, others would like to implement ObjectMapperConfigurer can either extend DefaultObjectMapperConfigurer to keep default configuration (with some extra configuration) or implement its own by directly implement ObjectMapperConfigurer.
  2. ConfiguringObjectMapperProvider optionally accept a pre-configured ObjectMapper as the base, then call ObjectMapperConfigurer to decorate it.
sammyhk added a commit to sammyhk/graphql-java-servlet that referenced this issue May 7, 2019
@oliemansm oliemansm added this to the 7.5.0 milestone May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants