Skip to content
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

Expose functionality for disabling Swagger validation #4

Closed
kfh opened this issue Oct 24, 2022 · 5 comments
Closed

Expose functionality for disabling Swagger validation #4

kfh opened this issue Oct 24, 2022 · 5 comments

Comments

@kfh
Copy link

kfh commented Oct 24, 2022

It would be nice to have functionality for disabling the default swagger validation that's visible on the landing page. Since in our case we are running all services in a Kubernetes cluster behind a VPN the callback validation always fails and give us an orange box in the right corner that says: INVALID.

@SMILEY4
Copy link
Owner

SMILEY4 commented Oct 24, 2022

Hi,
i'm not quite sure which validation or orange box you mean. Do you maybe have a screenshot or know a swagger/openapi-documentation for this ? I'm also having diffuculties reproducing the problem with a minimal example (though i havent done too much experimentation yet).

@kfh
Copy link
Author

kfh commented Oct 25, 2022

Hi,
i'm not quite sure which validation or orange box you mean. Do you maybe have a screenshot or know a swagger/openapi-documentation for this ? I'm also having diffuculties reproducing the problem with a minimal example (though i havent done too much experimentation yet).

Allright, best described by a screenshot probably.

invalid

So this is activated by default, i'm for sure not doing anything to enable that validation. If the box is clicked one is redirected to validator.swagger.io with an error message indicating the validation failed because it can't reach the server as explained initially.

@kfh
Copy link
Author

kfh commented Oct 25, 2022

https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#network

Have a look at the validatorUrl parameter. I would suggest that you expose a thin convenience layer where you offer an boolean property ala validation which defaults to true

@SMILEY4
Copy link
Owner

SMILEY4 commented Oct 25, 2022

thanks for the hint. The validation doesnt happen when running on localhost, so i didnt catch it when testing.
I created a new version (0.7.0) making this configurable. The validation is now disabled by default, but can be enabled or set to use a custom (self-hosted) validator.

@kfh
Copy link
Author

kfh commented Oct 26, 2022

thanks for the hint. The validation doesnt happen when running on localhost, so i didnt catch it when testing.
I created a new version (0.7.0) making this configurable. The validation is now disabled by default, but can be enabled or set to use a custom (self-hosted) validator.

Thanx! Works great, already deployed the new version 👍

@SMILEY4 SMILEY4 closed this as completed Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants