Closed rzachariah closed 8 years ago
@rzachariah - I don't want to throw you between projects, so I'll try to answer it here. This is not really related to the badge itself, but rather to the configuration of Swagger-UI, specifically SwaggerUi's initialization.
One of the initialization parameters for SwaggerUi is the validatorUrl
. Setting it to null would disable the validator.
Hmm. I tried nulling that out like this.
// enable SwaggerUI
subpath.use(swaggerExpress.runner.swaggerTools.swaggerUi({
url: getApiDocsUrl(),
validatorUrl: null
}));
No dice. :(
I don't know what version of swagger-ui swagger-express-mw uses, and this could be some other issue with swagger-express-mw itself... don't know how to help with that I'm afraid.
Thanks. Interestingly, I haven't made any changes, but the validation error badge is suddenly gone today.
Could be browser cache that didn't really reload the changes. Can we close the ticket?
Go for it. Thanks.
I used swagger project create/edit to define a new node service. With swagger project verify, I see that my API definition is fine. It also works fine locally and in prod. However, when I deploy to an https endpoint with DNS, I get a validation error badge from the swagger docs page. If I click the badge, I get this message.
I first posted this problem on the swagger-tools issues page. They advised me that I was posting within the wrong project. They also diagnosed that the problem is that my service is on my intranet, and the validation service can't reach it.
Fair enough.
I'm not clear on how to disable swagger validation with my setup. I'm using swagger-express-mw. Could you give me a hint on how to do that?
Here's a snip from package.json.
This is how I start the server.