swagger-api / swagger-api/swagger-codegen-generators
[Micronaut] Parameter bean validation issues
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
On using the micronaut code generator, there were few issues with regards to how the bean validations were applied on the api interfaces generated
- if a query parameter is declared as required, in the swagger file the generated API has 2 declarations of
@NotNull - if a parameter(query or header) is declared as
required: false, Micronaut requires an explicit@Nullablekeyword - header parameters do not have bean validation implemented currently (e.x
Pattern,Size,minLengthetc)
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 at the Micronaut code generator entry point and locate the templates that produce API interfaces and parameter annotations. Compare generated query and header parameters with the Swagger requirements, then verify that required parameters have one validation annotation, optional parameters are explicitly nullable, and header constraints are emitted.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100