Skip to content

[OpenAPI 2.0] The "Explode" property value is always true for query string parameters of array type. #1340

@SergeyMenshykh

Description

@SergeyMenshykh

Describe the bug
The Explode property of the OpenApiParameter class is always set to true, regardless of whether the collectionFormat property is explicitly set to csv or omitted when parsing query string parameters of array type in OpenAPI v2.0 documents.

To Reproduce

  1. Create an OpenAPI document of version 2.0.
  2. Add any operation with two query string parameters of array type: one without the collectionFormat property and the other with the property explicitly set to csv. See the screenshot below.
  3. Parse/read the document using the openApiReader.ReadAsync method.

Actual behavior
The Explode property value for both parameters is true. See the screenshot below.

Expected behavior
The Explode property value should be false for both parameters. For the parameter with the omitted collectionFormat property, the Explode property should also be false because, according to the OpenAPI 2.0 spec, the default value for the collectionFormat is csv, which implies that it should not be "exploded" (i.e., one parameter with comma-separated values should be used), as far as I understand it.

Screenshots/Code Snippets
image
image
image

Additional context
The issue was discovered while exploring serialization details for query string parameters. No customers have been impacted by it so far.

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