小编JAK*_*JAK的帖子

ASP.NET Core RC1 - WebAPI Swagger集成 - "错误"SchemaValidationMessages

我在我的ASP.NET Core RC1应用程序中使用以下NuGet包集成了swagger.

"Swashbuckle.SwaggerGen": "6.0.0-rc1-final",
"Swashbuckle.SwaggerUi": "6.0.0-rc1-final"
Run Code Online (Sandbox Code Playgroud)

这是swagger集成的代码.

    public void ConfigureServices(IServiceCollection services)
    {
        ....
        .....

        //*** Configure Swagger Document Information.
        services.ConfigureSwaggerDocument(options =>
        {
            //*** Define incremental API version.
            options.SingleApiVersion(new Info
            {
                Version = "v1",
                Title = "TEST APIs",
                Description = "Test API Methods",
                TermsOfService = "",
            });


            //*** Assign the API - Swagger helper document.
            options.OperationFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlActionComments(helperDocPath));

        });

        //*** Configure the Swagger schema settings.
        services.ConfigureSwaggerSchema(options =>
        {
            options.DescribeAllEnumsAsStrings = true;
            options.ModelFilter(new Swashbuckle.SwaggerGen.XmlComments.ApplyXmlTypeComments(helperDocPath));
        });

       ....
       ....
    }

    //**** Configure Method

    private …
Run Code Online (Sandbox Code Playgroud)

c# swagger asp.net-core

7
推荐指数
2
解决办法
1352
查看次数

标签 统计

asp.net-core ×1

c# ×1

swagger ×1