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

validatorUrl=null parameter does not work #1698

Closed
DavidBiesack opened this issue Oct 22, 2015 · 8 comments
Closed

validatorUrl=null parameter does not work #1698

DavidBiesack opened this issue Oct 22, 2015 · 8 comments

Comments

@DavidBiesack
Copy link

Issue #630 does not seem to be fixed.

I'm following https://github.com/swagger-api/swagger-ui#parameters
but appending &validatorUrl=null does not work; I still get the red error badge

http://swagger.na.sas.com/swagger-ui/?url=http://swagger.na.sas.com/apis/reports/v1/swagger.json&validatorUrl=null

Also, I really need some way to disable this in index.html or elsewhere, not on the URL,
because I can't control who uses the URL and folks will omit this option.

Issue #630 includes a link to index.html which should show how to set it:
https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html#L33
but it is not a link to a specific commit, so the line number is wrong

@webron
Copy link
Contributor

webron commented Oct 26, 2015

@DavidBiesack - the validatorUrl is a parameter to the SwaggerUi object. You can add it in your index.html in the object definition: https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html#L43. You'll notice there are a few of the parameters defined there by default.

@DavidBiesack
Copy link
Author

Thanks, I misread the doc and though it referred to URL parameters (I know I can pass ?url= in the swagger-ui URL)

@webron
Copy link
Contributor

webron commented Oct 26, 2015

@DavidBiesack - did it work for you? Are we good to close the issue?

@DavidBiesack
Copy link
Author

Yes, works for me. thanks.

@webron
Copy link
Contributor

webron commented Oct 26, 2015

Ok, thanks for confirming.

@webron webron closed this as completed Oct 26, 2015
@chenjianjx
Copy link

Can we make it a parameter like the OP thinks it was? It's actually a common config.
I even think frontend validation should be disabled by default, because only this way we can test if the backend has implemented the validation well.

@chenjianjx
Copy link

And it doesn't work for me even if I updated dist/index.html.

      window.swaggerUi = new SwaggerUi({
        url: url,
        dom_id: "swagger-ui-container",
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        validatorUrl: null, 

I changed the last line to "validatorUrl:undefined". Still not working. Swagger UI still requires me to input value for required fields.
I am using the newest code.

Can you give an exact example of how to set this up ?

@fabpico
Copy link
Contributor

fabpico commented Feb 2, 2018

@webron I still have this issue like @chenjianjx .

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

4 participants