使用Web API并使用swashbuckle生成详尽的文档,我在两个不同的命名空间中定义了两个具有相同名称的不同类。当我在浏览器中打开打开页面时,它说
冲突的schemaIds:检测到类型A和B重复的schemaIds。有关可能的解决方法,请参阅配置设置-“ UseFullTypeNameInSchemaIds”
完整讯息:
500:{“消息”:“发生错误。”,“ ExceptionMessage”:“冲突的schemaId:检测到类型A和B的重复的schemaId。请参见配置设置-\” UseFullTypeNameInSchemaIds \“以获取可能的解决方法”,“ ExceptionType Swashbuckle.Swagger.SchemaRegistry.CreateRegistry.CreateInlineSchema(类型)\ r \ n在Swashbuckle.Swagger。“”:“ System.InvalidOperationException”,“ StackTrace”:“在Swashbuckle.Swagger中。 SchemaRegistry.b__1f(JsonProperty prop)\ r \ n位于System.Linq.Enumerable.ToDictionary [TSource,TKey,TElement](IEnumerable
1 source, Func
2 keySelector,Func2 elementSelector, IEqualityComparer
1比较器)\ r \ n在Swashbuckle.Swagger.SchemaRegistry.CreateObjectSchema(JsonObjectContract jsonContract)\ r \ n在Swashbuckle.Swagger.SchemaRegistry.CreateDefinitionSchema(Type type)\ r \ n在Swashbuckle.Swagger.SchemaRegistry.GetOrRegister(Type type )\ r \ n在Swashbuckle.Swagger.SwaggerGenerator.CreateOperation(ApiDescription apiDesc,SchemaRegistry schemaRegistry)\ r \ n在Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable1 apiDescriptions, SchemaRegistry schemaRegistry)\r\n at Swashbuckle.Swagger.SwaggerGenerator.<>c__DisplayClass7.<GetSwagger>b__4(IGrouping
2 group)\ r \ n在System.Linq.Enumerable.ToDictionary [ TSource,TKey,TElement](IEnumerable1 source, Func
2 keySelector,Func2 elementSelector, IEqualityComparer
1个比较器)\ r \ n在Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(字符串rootUrl,字符串apiVersion)\ r \ n在Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage请求,CancellationToken cancelToken)在System.Net。 Http.HttpMessageInvoker.SendAsync(HttpRequestMessage请求,CancellationToken cancelToken)\ r \ n在System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage请求,CancellationToken cancelToken)\ r \ n在System.Net.Http.DelegatingHandler.SendAsync( HttpRequestMessage请求,CancelationToken cancellingToken)\ r \ n位于System.Web.Http.HttpServer.d__0.MoveNext()“} http:// localhost:24215 / swagger / docs / v1
我不想更改班级名称。我该如何解决?