- Notifications
You must be signed in to change notification settings - Fork 112
Closed
Milestone
Description
Currently configuring ObjectMapper can be either:
- implement
ObjectMapperConfigurerwhich is in decorator pattern, cannot use the existing ObjectMapper configuration used in other part of the system. - implement
ObjectMapperProviderto create/ re-use existing ObjectMapper configuration, but this way may have code coupling onConfiguringObjectMapperProviderbecause current implementation some configuration is hard-coded inConfiguringObjectMapperProvider(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:
- move those hard-coded configuration in
ConfiguringObjectMapperProvidertoDefaultObjectMapperConfigurer, others would like to implementObjectMapperConfigurercan either extendDefaultObjectMapperConfigurerto keep default configuration (with some extra configuration) or implement its own by directly implementObjectMapperConfigurer. ConfiguringObjectMapperProvideroptionally accept a pre-configuredObjectMapperas the base, then callObjectMapperConfigurerto decorate it.
Metadata
Metadata
Assignees
Labels
No labels