How to disable swagger validator when using Swashbuckle for net core api project. Swashbuckle 6.0.0

How to disable Swagger scheme validator in Swashbuckle 6.0.0 parameters. I know that it is disabled by default when I run locally, but don’t see the validatorURL option for SwaggerUI ()

+4
source share
4 answers

There seems to be an option for Swaffger 6.0.0 to manage Validator.

I have not tried myself, but it seems to be pretty clear about what he is doing.

+1
source

Swashbuckle 6.0.0 Swashbuckle.AspNetCore 1.0.0. ...

DisableValidator (.NET Framework) EnableValidator (.NET Core), document. , Validator Swashbuckle.AspNetCore 1.0.0.

app.UseSwaggerUI(c =>
{
    c.EnabledValidator();
    /* ... */
});
+1
source
var config = new HttpConfiguration();
config.EnableSwagger(c =>{ })
      .EnableSwaggerUi(c => { c.DisableValidator(); });   
0
source

Source: https://habr.com/ru/post/1657093/


All Articles