What is the recommended way to force a query string array parameter to be treated with style form and explode false

Viewed 287

I want my api to accept a query string array parameter in the form ?id=a,b,c,d as opposed to the standard ?id=a&id=b&id=c. For this I am following this excellent blog article.

Side question: Does ASP.NET Core provide built-in providers/attributes for that yet?

My main question however, is about SwashBuckle.AspNetCore:

In short, I'm trying to get a comma-separated parameter (?p=a,b,c,d) that is typed as an IEnumerable<string>, to show up correctly in the generated Swagger. According to the specs it should get style=form and explode=false. The default here (style=form and explode=true) matches the asp.net core default. How do I achieve this? Is there an annotation attribute that I can place on the parameter?

0 Answers
Related