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

NSwag generating request string[] headers incorrectly #4847

Open
Witted opened this issue Apr 8, 2024 · 0 comments
Open

NSwag generating request string[] headers incorrectly #4847

Witted opened this issue Apr 8, 2024 · 0 comments

Comments

@Witted
Copy link

Witted commented Apr 8, 2024

Stackoverflow issue here: https://stackoverflow.com/questions/78279410/swagger-generating-request-string-headers-incorrectly

The generated swagger appears to be handing string[] headers incorrectly.

{
"name": "permissions",
"in": "header",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
}
},
"x-position": 2
},

Style is set as form when documentation suggests it should be simple https://swagger.io/docs/specification/serialization/

This means that a request generated in swagger looks like:

-H 'permissions: 1&permissions=2&permissions=3'

when it should be:

-H 'permissions: 1,2,3'

@Witted Witted changed the title Nswag generating request string[] headers incorrectly NSwag generating request string[] headers incorrectly Apr 8, 2024
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

No branches or pull requests

1 participant