RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.61k stars 1.22k forks source link

NSwag generating request string[] headers incorrectly #4847

Open Witted opened 3 months ago

Witted commented 3 months ago

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'