swagger-api / swagger-api/swagger-codegen
@Pattern @NotNull validation not added to swagger specification from code
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
I have generated a Java Spring project using CodeGen from a pre-defined Swagger Specification. In the code I can see the @Pattern, @NotNull added to the correct fields. However if I manually add @Pattern to new fields and try to look at the swagger by going to .../api-docs URL, I don't see these being added to the field in swagger definitions.
Swagger-codegen version
Spring fox version 2.5.0
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
Reproduce the generated Java Spring project with Spring Fox 2.5.0 and inspect the /api-docs output for fields carrying manually added @Pattern and @NotNull annotations. Compare those definitions with the generated code and the original Swagger specification; done means the annotations are represented correctly in the generated API documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100