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

Avoid explicitly inject ObjectMapper to the ObjectMapper #177

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

Avoid explicitly inject ObjectMapper to the ObjectMapper #177

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

Comments

@sammyhk
Copy link
Contributor

sammyhk commented May 7, 2019

ConfiguringObjectMapperProvider explicitly inject ObjectMapper to the ObjectMapper:
https://github.com/graphql-java-kickstart/graphql-java-servlet/blob/master/src/main/java/graphql/servlet/ConfiguringObjectMapperProvider.java#L27
Which is used in VariablesDeserializer:
https://github.com/graphql-java-kickstart/graphql-java-servlet/blob/master/src/main/java/graphql/servlet/internal/VariablesDeserializer.java#L18

Checked Jackson 2 API, this is not needed by using ObjectCodec API (abstract class of ObjectMapper) which can achieve the same goal.
Example (Before):

objectMapper.readValue(str, typeReference);

(After):

objectCodec.readValue(objectCodec.getFactory().createParser(str), typeReference);
sammyhk added a commit to sammyhk/graphql-java-servlet that referenced this issue May 7, 2019
oliemansm added a commit that referenced this issue May 21, 2019
…pper

#177 Avoid explicitly inject ObjectMapper to the ObjectMapper
@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