Description
We have to deal with multiple named ObjectMappers in our Application.
Using @EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
leads to the following Exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hypermediaWebFluxConfigurer' defined in class path resource [org/springframework/hateoas/config/WebFluxHateoasConfiguration.class]: Failed to instantiate [org.springframework.hateoas.config.WebFluxHateoasConfiguration$HypermediaWebFluxConfigurer]: Factory method 'hypermediaWebFluxConfigurer' threw exception with message: No qualifying bean of type 'com.fasterxml.jackson.databind.ObjectMapper' available: expected single matching bean but found 2: customizedObjectMapperAAA,customizedObjectMapperBBB
I did not find a possibility to hook into the configuration to use a specific ObjectMapper. The only way to workaround this problem is to use the @Primary
annotation to select the preferred ObjectMapper bean.
Is there a way to configure the ObjectMapper? If not it would be nice to have such a possibility to do so.