Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DefaultCodegenConfig] Handle default parameter values #565

Merged

Conversation

michaeldavis-wf
Copy link
Contributor

Parameter default values are not being generated. This appears to be due to not copying the values from the Swagger Parameter object over to the Codegen Parameter object. I copied some of that logic from the master branch and updated it slightly.

Using this (partial) definition:

paths:
  /scim2/Users:
    get:
      summary: Retrieve users
      description: Retrieve a collection of user resources for the authorized organization.
      operationId: listUsers
      parameters:
        - name: startIndex
          description: An integer indicating the 1-based index of the first query result.
          in: query
          required: false
          schema:
            type: integer
            format: int32
            minimum: 1
            default: 1

Generated code used to look like:

@Parameter(in = ParameterIn.QUERY, description = "An integer indicating the 1-based index of the first query result.", schema=@Schema(allowableValues={  }, minimum="1")) @QueryParam("startIndex") Integer startIndex

And now looks like:

@Parameter(in = ParameterIn.QUERY, description = "An integer indicating the 1-based index of the first query result.", schema=@Schema(allowableValues={  }, minimum="1")) @DefaultValue("1") @QueryParam("startIndex") Integer startIndex

@michaeldavis-wf
Copy link
Contributor Author

@frantuma, @webron, @HugoMario Could one of you look at this.

@matthewsullivan-wf
Copy link

@HugoMario thanks for merging our other bugfix. Could I humbly ask you look at this one as well in the next week or so?

@HugoMario HugoMario merged commit 52518eb into swagger-api:master Jan 30, 2020
@HugoMario
Copy link
Contributor

thanks a lot @michaeldavis-wf and @matthewsullivan-wf.

Please, ping any time you need help with something.

@matthewsullivan-wf
Copy link

Thank you!

@michaeldavis-wf
Copy link
Contributor Author

michaeldavis-wf commented Jan 30, 2020

Thank you, @HugoMario!

Are the releases of this repo scheduled, or are they by request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants