Skip to content

@Schema annotation is not picked up when using @JsonValue from Jackson #3904

@martin-tarjanyi

Description

@martin-tarjanyi

See: springdoc/springdoc-openapi#1077

I debugged the code and I found the issue at the following place:

AnnotatedType aType = new AnnotatedType()
.type(jsonValueType)
.parent(annotatedType.getParent())
.name(annotatedType.getName())
.schemaProperty(annotatedType.isSchemaProperty())
.resolveAsRef(annotatedType.isResolveAsRef())
.jsonViewAnnotation(annotatedType.getJsonViewAnnotation())
.propertyName(annotatedType.getPropertyName())
.skipOverride(true);

Unlike in other places, at this point the .ctxAnnotations(schemaAnnotations) method is not called which results in the loss of data coming from @Schema annotation.

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