这个错误500返回swagger的文档

时间:2017-10-17 16:42:59

标签: c# asp.net-web-api2 swagger swagger-ui

InvalidOperationException:冲突的schemaIds:为类型BTBTems.DataModel.Ticket.ChamadoDM和BTBTems.DataModel.Chamado.ChamadoDM检测到相同的schemaId。有关解决方法,请参阅配置设置 - “UseFullTypeNameInSchemaIds”或“CustomSchemaIds”

1 个答案:

答案 0 :(得分:0)

更新您的swagger配置文件( .. \ AppStart \ SwaggerConfig.cs )以致电c.UseFullTypeNameInSchemaIds()

         GlobalConfiguration.Configuration 
            .EnableSwagger(c =>
                {
                    //....
                    c.UseFullTypeNameInSchemaIds();  // <-- add this
                    //....
                })
            .EnableSwaggerUi(c =>
                {

                });