Can't read from file issue in Swagger UI

后端 未结 6 1581
无人共我
无人共我 2021-01-31 13:07

I have incorporated swagger UI in my application.

When I try and see the swagger UI, I get the documentation of the API nicely but after some time it shows some error i

6条回答
  •  迷失自我
    2021-01-31 14:06

    To supplement the accepted answer...I just uncommented one line in the SwaggerConfig.cs. I only wanted to get rid of the red error on the main swagger page by disabling the validator.

    // By default, swagger-ui will validate specs against swagger.io's online validator and display the result
    // in a badge at the bottom of the page. Use these options to set a different validator URL or to disable the
    // feature entirely.
    //c.SetValidatorUrl("http://localhost/validator");
    c.DisableValidator();
    

提交回复
热议问题