restdocs-api-spec icon indicating copy to clipboard operation
restdocs-api-spec copied to clipboard

Documenting Bean Validation constraints not supporting spring boot 3

Open samhyun opened this issue 1 year ago • 2 comments

Hello!

I discovered that documentation of constraint conditions is not working properly while migrating to Spring Boot version 3.

I think adding jakarta.validation.constraints classes within the com.epages.restdocs.apispec.jsonschema.ConstraintResolver file might work.

Can you take care of this?

samhyun avatar Jan 10 '24 01:01 samhyun

any update on this issue?

tadlakha9 avatar Apr 03 '24 07:04 tadlakha9

Hello

any update on it

deepakraghav0 avatar May 02 '25 09:05 deepakraghav0

Currently, when using Jakarta Bean Validation constraints in the OAS file, we have to manually add validation metadata like this:

.attributes(key("validationConstraints")
            .value(List.of(new Constraint(
                    "javax.validation.constraints.NotBlank",
                    Map.of()
))))

This process is quite cumbersome. I would like to improve this by:

Extending ConstraintResolver to support jakarta.validation.constraints.*

Adding relevant unit tests

If no one else is working on this issue, I'd be happy to take it on and open a PR. Please let me know if that's okay.

HeeChanN avatar Jul 13 '25 05:07 HeeChanN