-
Notifications
You must be signed in to change notification settings - Fork 707
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
Incorrectly generated metadata for arrays in Swagger for .NET Core with OData #999
Comments
Hope not a big deal @commonsensesoftware 😅 |
People still actually use collection parameters? 🤔 🤣 Sadly, this is kind of a big deal. The solution is not so simple. This is more of an issue with OData than anything else. If they'd ever formally support the API Explorer, it would save us all a bunch of headaches. There are several parts to the problem. First and foremost, using Since collection and object literals have a special syntax, I'm curious if or how you got it to work with vanilla OData. The API Versioning routing was fine, but I couldn't get the value to properly bind unless I wrote the action as: [HttpGet( "api/" + nameof( CountThem ) + "(Vars={vars})" )]
[ProducesResponseType( typeof( int ), Status200OK )]
public IActionResult CountThem( [FromODataUri] string[] vars ) => Ok( vars.Length ); This problem/limitation almost certainly applies to object literals too; however, no one has ever asked for that support. Phew!😅 |
Yes, it seems not so simple, by the way, about the absence of [FromOdata] in CountThem, when I made a new method I looked at |
Is there an existing issue for this?
Describe the bug
It seems like in the current version issue #496 appears again
Generated request GET: https://localhost:5001/api/CountThem(Vars=%271%27,%272%27,%273%27) (Square brackets are missing)
Expected Behavior
Expected GET: https://localhost:5001/api/CountThem(Vars=[%271%27,%272%27,%273%27])
Steps To Reproduce
Repro steps using ODataOpenApiExample:
Add this code to the functions controller
And this line to AllConfigurations class
Run Swagger
Add multiple parameters line by line e.g. '1' '2' '3'
Press Execute
Exceptions (if any)
.NET Version
7
Anything else?
No response
The text was updated successfully, but these errors were encountered: