Skip to content

[java jaxrs-jersey] default values are never generated in annotations #166

Open
@tomzo

Description

@tomzo

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions