Skip to content

Hateos HandlerInstantiator overrides Jackson's HandlerInstantiator #3979

Closed
@countrogue

Description

@countrogue

Im trying to autowire my JsonSerializer/JsonDeserializer.

    return new Jackson2ObjectMapperBuilder()
                          .deserializerByType(ObjectX.class, objectXDeserializerBean)
                          .applicationContext(applicationContext);

It works with the global deserializer objectXDeserializerBean(above), but when deserializing specific fields like the following(below) it doesn't work:

class ObjectY {
    @JsonDeserialize(using = ObjectZDeserializer.class)
    private ObjectZ myField;
}

The problem is that HypermediaAutoConfiguration is overriding the HandlerInstantiator in jackson2ObjectMapper so the only work around i can do right now is to set spring.hateoas.apply-to-primary-object-mapper=false. WIth that i was forced to abandon hateos in my responses. Can anyone help me with this?

Metadata

Metadata

Assignees

Labels

status: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions