swagger-api / swagger-api/swagger-codegen
issue for --additional-properties useBeanValidation=false
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
In the following classes:
io.swagger.codegen.languages.JavaJAXRSCXFCDIServerCodegen#processOpts
io.swagger.codegen.languages.JavaResteasyEapServerCodegen#processOpts
io.swagger.codegen.languages.SpringCodegen#processOpts
io.swagger.codegen.languages.AbstractJavaJAXRSServerCodegen#processOpts
the code 'if (useBeanValidation) {writePropertyBack(USE_BEANVALIDATION, useBeanValidation);} ‘ replace with 'writePropertyBack(USE_BEANVALIDATION, useBeanValidation);'
The reason is that When the condition for ‘--additional-properties useBeanValidation=false’,but
The result of ‘additionalProperties.get(USE_BEANVALIDATION)' is 'false' that is String ,{{#useBeanValidation}}hello world{{/useBeanValidation}} shows the hello world,The real result should not show hello world
Swagger-codegen version
version is 2.4.4
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
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 in processOpts in JavaJAXRSCXFCDIServerCodegen, JavaResteasyEapServerCodegen, SpringCodegen, and AbstractJavaJAXRSServerCodegen. Trace how --additional-properties useBeanValidation=false is stored and consumed by the Mustache conditional. Done means the generated output does not render the conditional content when the option is false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100