Skip to content

Support Composed Constraints #4799

Open
@michael-arndt-gcx

Description

@michael-arndt-gcx

Jakarta Bean Validation allows to compose constraints as described in 3.3. Constraint composition.

I'd like to implement basic support for this. My idea would be to add a preprocessing step to

protected void applyBeanValidatorAnnotations(BeanPropertyDefinition propDef, Schema property, Annotation[] annotations, Schema parent, boolean applyNotNullAnnotations) {

which flattens all Annotations. That means: when an annotation is annotated with javax.validation.Constraint, all its annotations are treated as if all annotations are on the annotated element.

This has been requested as feature e.g. in springdoc/springdoc-openapi#1486

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