schemaValidationMessages on swagger-ui

4,569 views
Skip to first unread message

haik...@gmail.com

unread,
May 11, 2016, 7:51:03 PM5/11/16
to Swagger
I am getting the following error message in the Swagger-ui, which otherwise functions normally:

{"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://nimbledev:8080/store/api/swagger.json"}]}

What could be causing that? How do I make it go away?


Any info would be appreciated.





Screen Shot 2016-05-11 at 4.49.18 PM.png

tony tam

unread,
May 11, 2016, 7:59:03 PM5/11/16
to swagger-sw...@googlegroups.com
Hi, looks like your specification is not publicly accessible and therefore the validator cannot check it.  Just set the validatorUrl to `null`, per the README:

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screen Shot 2016-05-11 at 4.49.18 PM.png>

MMR

unread,
Oct 10, 2016, 11:55:41 AM10/10/16
to Swagger, haik...@gmail.com
I am getting the same error and indeed my host is not publicly accessible. Setting "this.model.validatorUrl = null;" in all places in swagger-ui.js and swagger-ui.min.js does not eliminate the issue. Any suggestion would be appreciated.

tony tam

unread,
Oct 10, 2016, 11:57:18 AM10/10/16
to swagger-sw...@googlegroups.com, haik...@gmail.com
I believe you need to set it when initializing swagger-ui in your index.html

On Oct 10, 2016, at 8:55 AM, MMR <mmr1...@gmail.com> wrote:

I am getting the same error and indeed my host is not publicly accessible. Setting "this.model.validatorUrl = null;" in all places in swagger-ui.js and swagger-ui.min.js does not eliminate the issue. Any suggestion would be appreciated.

MMR

unread,
Oct 10, 2016, 1:17:47 PM10/10/16
to Swagger, haik...@gmail.com
Thanks. How do you that? Several variations of this did not work:

      window.swaggerUi = new SwaggerUi({
        url: url,
        dom_id: "swagger-ui-container",
        validatorUrl: null,
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        onComplete: function(swaggerApi, swaggerUi){
          if(typeof initOAuth == "function") {
            initOAuth({
              clientId: "your-client-id",
              clientSecret: "your-client-secret-if-required",
              realm: "your-realms",
              appName: "your-app-name",
              scopeSeparator: " ",
              additionalQueryStringParams: {}
            });
          }

MMR

unread,
Oct 10, 2016, 2:06:55 PM10/10/16
to Swagger, haik...@gmail.com
Never mind. Somehow redeploying the app took care of it. Thanks for the tips.

tony tam

unread,
Oct 10, 2016, 2:07:57 PM10/10/16
to swagger-sw...@googlegroups.com, haik...@gmail.com
OK great

On Oct 10, 2016, at 11:06 AM, MMR <mmr1...@gmail.com> wrote:

Never mind. Somehow redeploying the app took care of it. Thanks for the tips.


Reply all
Reply to author
Forward
0 new messages