swagger-api / swagger-api/swagger-codegen-generators
[java jaxrs-jersey] default values are never generated in annotations
@HugoMario is already working on this.
Since Sep 6, 2018.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
In all operations I have in my 3.0 spec, swagger-codegen never emits @DefaultValue annotation, although it exists on parameter definitions.
For parameter in operation like this:
put:
operationId: putExactResultZip
tags:
- results
parameters:
- name: failed
in: query
schema:
type: boolean
default: false
Emitted code for parameter is
,@Parameter(description = "") @QueryParam("failed") Boolean failed
While I would expect it to include the default value:
,@Parameter(description = "") @QueryParam("failed") @DefaultValue("false") Boolean failed
It does not matter what is the type of default, in a big project with many uses of default I see no @DefaultValue annotations in generated code.
Version info
Swagger-codegen (build from 3.0.0 release 713d52883cf320d46fb1a555c63e8ad99f78c16e), which is using 1.0.0 release of swagger-codegen-generators.
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.
Assessment
This issue has not been assessed yet.