Swagger UI shows error (validation) when deployed

lostintranslation picture lostintranslation · Jan 7, 2015 · Viewed 26.3k times · Source

I have the swagger ui embedded in my application. And when I run my node application locally the UI works great.

However when I deploy the UI to my 'real' server I get an error image in the bottom right of my swagger ui:

enter image description here

I am sure this is something I am doing that is screwing it up but I have no idea. Again works locally when I access swagger ui via http.

However when I deploy I run through apache and serve out over https, I see an error. Even worse none of my 'Try it' calls work when deployed. Seems like the request is not being made.

Looks like the UI makes a call to a validator with my swagger.json, however that call works locally.

What am I doing wrong?

When I click the error icon, I get:

enter image description here

Answer

Sasha Bond picture Sasha Bond · Jul 30, 2015

To turn off swagger validator add validatorUrl : null, in dist/index.html in

  window.swaggerUi = new SwaggerUi({
    url: url,
    validatorUrl : null,
    dom_id: "swagger-ui-container",