I recently noticed that web api swagger UI contains Error notification on footer
{"schemaValidationMessages":[{"level":"error","message":"Can't read from file https:///swagger/docs/v1"}]}
Swagger UI use online validator to web api swagger document. If API URL is not accessible in public, then
this schema validation message is occurred.
There are two ways to rectify this schema validation error.
· Disable Swagger Validation in SwaggerConfig.cs
GlobalConfiguration.Configuration.EnableSwagger().EnableSwaggerUi(c => { c.DisableValidator(); });
· API URL should be public available.
Thanks for visiting!!
No comments:
Post a Comment