Skip to content

Problem with muliple ObjectMapper and WebFluxHateoasConfiguration.HypermediaWebFluxConfigurer.hypermediaWebFluxConfigurer(...) #2273

Open
@pblanche

Description

@pblanche

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions