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

Validator badge is always enabled and can't be disabled #2761

Closed
Deraen opened this issue Mar 21, 2017 · 4 comments
Closed

Validator badge is always enabled and can't be disabled #2761

Deraen opened this issue Mar 21, 2017 · 4 comments

Comments

@Deraen
Copy link

Deraen commented Mar 21, 2017

Previously validator badge was hidden if the false value (null, false) was explicitly provided as validatorUrl, or if the spec was being loaded from localhost: https://github.com/swagger-api/swagger-ui/blob/2.x/src/main/javascript/view/MainView.js#L57-L65

New validator badge component always uses the default url if validatorUrl value is not truthy:

validatorUrl: validatorUrl || "https://online.swagger.io/validator"

I think the default validatorUrl should only be used if the value is undefined, that is, when no explicit value is not set. Hiding the validator when spec is served from localhost is also good idea, as validating that going to fail always.

@i-ghost
Copy link

i-ghost commented Mar 22, 2017

It was quite useful to set a value of null as we host static swagger-ui sites which the validator can't reach. The alternative is to host our own validator internally, which would be a waste of resources in our pipeline.

@fehguy
Copy link
Contributor

fehguy commented Mar 22, 2017

The ability to remove the validator is a missing feature. It will be addressed shortly

@bodnia
Copy link
Contributor

bodnia commented Mar 30, 2017

@Deraen @i-ghost in latest master validator badge can be disabled with config validatorUrl other than undefined, when undefined - default validator is displayed

@bodnia
Copy link
Contributor

bodnia commented Mar 30, 2017

fixed with 0b668cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants