-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Swagger-UI not producing an error when query string is added to the path #4498
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
Swagger-UI does not display errors on malformed API definitions (for the most part) and that's on purpose. The validation badge that you see at the bottom should give an indication if the definition is valid or not. If it doesn't produce an error, then this should be reported on the validator-badge project. |
Thank you for your reply @webron. I cannot seem to find a validation badge so I am assuming that this is an error with the validator-badge and will forward the issue to that project. |
I think that the validation badge is not shown with OAS 3.x 3.x
2.x |
@heldersepu is right, I've missed that this is OAS3. We should have the validator for OAS3 up and running within a few weeks. |
Locking due to inactivity. This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content. If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report. Thanks! |
window.versions.swaggerUi
in the console 3.13.5 is displayed even though I am importing a version 3.13.6According to this issue, Open API only uses the path portion of the resource identifier to identify operations. My expectation is that the swagger-ui will error if a path containing query parameters is set as one of the paths. For example
/protected-areas/id
is expected to work but not/protected-areas/id?_view=minimal
.In my case the above spec works perfectly fine, producing this result:

The UI is fully functional with no errors displayed. It is allowing me to run requests and it is displaying the results properly.
The main priority for me is allowing the users to see what properties are returned by which view and providing a different operation for each view does just that. That configuration does not meet the Open API Specification but that is not the main priority.
I am happy with the given behaviour but I am not sure if this is a bug or a feature since it is not supported by the Open API Specification. If this is going to be removed in a future version I would rather choose a different way of showing the different return formats for different views.
The text was updated successfully, but these errors were encountered: