-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Swagger-UI can't render content
inside a parameter
#4442
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
Possible duplicate of #3558. By the way, you example defines the
Is this actually the case?.. 🙀 Or are you trying to describe something like
? |
@hkosova That is the case unfortunately, horrific I know... Perhaps this kind of thing should never be possible then it would encourage people to write nice API's ☮️ |
@hazardfn oh, trust me, we don't encourage it. the added support for it in the spec, was due to existing APIs rather than advocating it for new APIs. |
@hkosova, is here a way to describe your example with openapi3? Looks like deepObject-way would not support indexes |
@aleskovets Are indexes in the query parameter array representable? |
The solution to the problem : "😱 Could not render this component, see the console." in Swagger Open API 3 can be resolved by following the link: https://swagger.io/docs/specification/describing-parameters/ |
@ksac1 how? when swagger-ui doesn't support ? |
@vinhlh : Yes, just follow the way of writing the path parameters and query parameters on the link: https://swagger.io/docs/specification/describing-parameters/ It really worked for me. |
@hkosova : |
content
inside a parameter
@shockey do you guys have any plan to support this? |
Probably not the right place for this, but this issue is reference in the Swagger documentation and it seems like the documentation may no longer be accurate. |
@jessebrennan Thanks, the documentation has been updated to reflect that parameters with |
@hkosova This only supports simple json objects, right? Tried to use content with type array of objects but its not working. Example case use: ?sort=[{"property":"date", "direction":"ASC"}] Tried with: "parameters": {
"in": "query",
"name": "sort",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"property": {
"type": "string"
},
"direction": {
"type": "string"
}
}
}
}
}
}
} |
@akrz if something does not work please open a new issue and fill in the details in the template. |
Demonstration API definition
Try and add a query parameter referencing an object (which according to the spec is a valid thing to do)
Configuration (browser query string, constructor, config.yaml)
I am using no additional config options, everything is vanilla.
Expected Behavior
The UI should offer me a nice way of typing in arrays of objects in a query param. According to the documentation this should be possible:
Current Behavior
Context
Just an honest labourer trying to document a horrendous API I didn't write 🤣
The text was updated successfully, but these errors were encountered: