Skip to content

Converting "collectionFormat: csv" in OAS2 to OAS3 #76

@wing328

Description

@wing328

Checklist

  • Conversion: I have checked my source definition is valid OpenAPI 2.0
  • Conversion: On valid OpenAPI 2.0 input, the conversion looks wrong

Detailed Description

When converting the following endpoint in petstore.yaml from OAS2 to OAS3 using the online converter:

  /pet/findByStatus:
    get:
      tags:
        - pet
      summary: Finds Pets by status
      description: Multiple status values can be provided with comma separated strings
      operationId: findPetsByStatus
      produces:
        - application/xml
        - application/json
      parameters:
        - name: status
          in: query
          description: Status values that need to be considered for filter
          required: true
          type: array
          items:
            type: string
            enum:
              - available
              - pending
              - sold
            default: available
          collectionFormat: csv

I got the following result in OAS3:

  /pet/findByStatus:
    get:
      tags:
        - pet
      summary: Finds Pets by status
      description: Multiple status values can be provided with comma separated strings
      operationId: findPetsByStatus
      parameters:
        - name: status
          in: query
          description: Status values that need to be considered for filter
          required: true
          style: form
          schema:
            type: array
            items:
              type: string
              enum:
                - available
                - pending
                - sold
              default: available

collectionFormat: csv in OAS2 should be converted to the following in OAS3 instead:

          in: query
          description: Status values that need to be considered for filter
          required: true
          style: form
          explode: false

but in the output generated by the online converter, explode: false is missing.

Ref:

Am I understanding OAS3 correctly in terms of how "collectionFormat: csv" (OAS2) should be defined in OAS3?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions