Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display constraints from x-field-extra-annotation parameter of Swagger/OpenAPI definition #10246

Open
mbesurich opened this issue Dec 25, 2024 · 0 comments

Comments

@mbesurich
Copy link

Content & configuration

Swagger/OpenAPI definition:

components:
 schemas:
   SomeDto:
     required:
       - someProperty
     type: object
     properties:
       someProperty:
         type: string
         x-field-extra-annotation:
               - "@jakarta.validation.constraints.NotEmpty"
              - "@org.hibernate.validator.constraints.UUID(allowNil = false)"

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Is your feature request related to a problem?

I use openapi-generator-maven-plugin to build DTO and Controller classes. I have to put some constraint annotations into x-field-extra-annotation of a parameter. But When I run the application I do not see these constraint annotations in swagger-ui.

Describe the solution you'd like

I want that swagger-ui displays values of x-field-extra-annotation for assosiated parameters of dto.

Describe alternatives you've considered

I tried to "override" indeh.html, and write there custom js plug whicj could display at least names on annotations from x-field-extra-annotation. But I figured out that swagger-ui does not receive any information from Swagger/OpenAPI definition .yaml file which is not shown in swagger-ui. I mean the dto's property does not contain x-field-extra-annotation parateters at all.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant