Skip to content

x-has-more incorrectly set on CodegenOperation allParams #297

@samuelhewitt

Description

@samuelhewitt

When using allParams, if there is a single bodyParam alongside other parameters, the vendorExtension x-has-more is overwritten with false. Most often, this ends up in missing commas in the generated files.

This is due to the bodyParam (and formParam) not being set as a copy in the various lists, instead the lists point to the same object.

An example test case is adding a put with body and path param to petstore-with-fake-endpoints-models-for-testing.yaml taken from the swagger-codegen project.

  '/pet/{petId}':
    put:
      tags:
        - pet
      summary: Updates a pet in the store with form data
      description: ''
      operationId: updatePetWithBody
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: petId
          in: path
          description: ID of pet that needs to be updated
          required: true
          type: integer
          format: int64
        - name: body
          in: body
          description: Pet to update
          required: true
          schema:
            $ref: '#/definitions/Pet'
      responses:
        '405':
          description: Invalid input
      security:
        - petstore_auth:
            - 'write:pets'
            - 'read:pets'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions