swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Support Composed Constraints

Open michael-arndt-gcx opened this issue 11 months ago • 2 comments

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 https://github.com/swagger-api/swagger-core/blob/df88c8a8ebaae1cb8ec39d1af295d07620dcaf87/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java#L1560

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 https://github.com/springdoc/springdoc-openapi/issues/1486

michael-arndt-gcx avatar Nov 26 '24 16:11 michael-arndt-gcx