Skip to content

Incorrect parsing of Explode property when parsing a Swagger 2.0 spec #1756

@ghost

Description

Describe the bug
When the Microsoft.OpenApi.Reader 1.6.13 is parsing a Swagger 2.0 spec, if it encounters the "collectionFormat" of csv for an array, it sets the Explode property to true instead of false.

OpenApi File To Reproduce
Add the OpenApi file you're using or a link to it as well as the steps to reproduce the current behavior.

Expected behavior
In the operation "Weather_GetHourlyForecast", one of the query parameters is Position which is an array whose "collectionFormat" is csv. Upon parsing, I would expect the Explode to be false and Style to be Form. For example, when the collectionFormat is ssv, the Explode is correctly parsed to be false and Style set to SpaceDelimited.

Screenshots/Code Snippets
Please find the image below which shows how the reader parses different collection formats
image

Additional context
Even though the default value of Explode is true when the Style is form, when the collection format is csv, it must be parsed as Explode false

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions