Skip to content

Why is @JsonTypeResolver separate from @JsonTypeInfo ? #44

Closed
@bytesandwich

Description

@bytesandwich

It seems in JacksonAnnotationIntrospector that @JsonTypeResolver cannot exist without @JsonTypeInfo

protected TypeResolverBuilder<?> _findTypeResolver(MapperConfig<?> config,
            Annotated ann, JavaType baseType)
    {
...
JsonTypeInfo info = ann.getAnnotation(JsonTypeInfo.class);
JsonTypeResolver resAnn = ann.getAnnotation(JsonTypeResolver.class);
if (resAnn != null) {
            if (info == null) {
                return null;
            }

Unless I misunderstood this, I think it is unnecessary and confusing.

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