swagger-api / swagger-api/swagger-ui
display constraints from x-field-extra-annotation parameter of Swagger/OpenAPI definition
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Swagger/OpenAPI schema in the issue and the SwaggerUI configuration path, then trace how vendor extensions are retained and rendered for DTO properties and parameters. Done means values from x-field-extra-annotation are visible for the associated parameters in Swagger UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100