-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Query parameters objects (like params[variable]=toto, ....) #595
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
Comments
I think this is more about tooling support. The OpenAPI specification allows you to describe parameters the way you requested already so nothing needs to change. Since you've already created an issue in swagger-ui (swagger-api/swagger-ui#2027), that's the best course of action. Since you were already talking to @webron in the swagger-ui issue, I'll let him decide how to handle this issue. |
If I understand what @nox-404 is asking, that's not really supported by the spec now. Query parameter names are not parameterized and can't be controlled that way. You can define an enum for the values, but not for the name. What concerns me here is the control on the type of the parameter. So if you have |
@webron yes that's what i mean, and i don't have any idea on how to describe it yet too |
Parent: #565 |
I don't understand how this can't be done by OpenAPI already. Take a look at apigee-127/swagger-tools#294 and you'll see that people are already doing this, although it's working due to the fact that the query string parsing library supports it. But in the referenced issue, you'll see how some are already doing this and it was a tooling issue to support it. |
That's a fair point. It could be a display issue only. Tools could have a way to collect It could also be a convenience issue - instead of having to repeat the same definition for each filter with a fixed name, you can have one with an enum of 'types' for the filter. Not sure this is something we need to support, but it's fair to consider. |
We have to workaround the issue today by passing stringified json to complex query parameters, for example:
|
@raymondfeng How do you define such format? I tried this in the swagger editor:
But it complains that
|
@raymondfeng @Vanuan please see here: For the next spec, you will be allowed complex parameters for all locations. What's left is the |
I don't quite understand what produces and consumes are used for and how are they related to serializationStrategy. |
See #804 |
For now, until we have schemas available for all parameters in the 3.0 spec, one option is to use a string like: Of course the server should be able to interpret them, but for new APIs I would recommend it. |
is it possible nowadays? i'm a little bit lost |
Hi,
I'm gonna be a bit lazy and just post it back here, so here is a question/suggestion/request
Is there a way to describe object parameters like this :
What i got :

What i need :

I originally posted it there
The text was updated successfully, but these errors were encountered: