Multiple operations with path 'api/Plan/AllocateTransport' and method 'GET'
2017-04-25 17:34
1681 查看
500 : {"Message":"出现错误。","ExceptionMessage":"Not supported by Swagger 2.0: Multiple operations with path 'api/Plan/AllocateTransport' and method 'GET'.
See the config setting - \"ResolveConflictingActions\" for a potential workaround","ExceptionType":"System.NotSupportedException","StackTrace":" 在 Swashbuckle.Swagger.SwaggerGeneratorOptions.DefaultConflictingActionsResolver(IEnumerable`1 apiDescriptions)\r\n
在 Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable`1 apiDescriptions, SchemaRegistry schemaRegistry)\r\n 在 Swashbuckle.Swagger.SwaggerGenerator.<>c__DisplayClass7.<GetSwagger>b__4(IGrouping`2 group)\r\n 在 System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1
source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)\r\n 在 Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\r\n 在 Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)\r\n 在 System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken
cancellationToken)\r\n 在 System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"} http://localhost:64922/swagger/docs/v1
-------------------------------------------------------------------------------------------
相信大家在使用Swagger 可能会出现以上错误。这个错误的引起是因为存在了多个GET方法不知道是Swagger本身的原因还是怎么回事。
如果出现以上的问题可以在“SwaggerConfig” 配置里启用这一行
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
但只能用一个GET方法
See the config setting - \"ResolveConflictingActions\" for a potential workaround","ExceptionType":"System.NotSupportedException","StackTrace":" 在 Swashbuckle.Swagger.SwaggerGeneratorOptions.DefaultConflictingActionsResolver(IEnumerable`1 apiDescriptions)\r\n
在 Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable`1 apiDescriptions, SchemaRegistry schemaRegistry)\r\n 在 Swashbuckle.Swagger.SwaggerGenerator.<>c__DisplayClass7.<GetSwagger>b__4(IGrouping`2 group)\r\n 在 System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1
source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)\r\n 在 Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\r\n 在 Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)\r\n 在 System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken
cancellationToken)\r\n 在 System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"} http://localhost:64922/swagger/docs/v1
-------------------------------------------------------------------------------------------
相信大家在使用Swagger 可能会出现以上错误。这个错误的引起是因为存在了多个GET方法不知道是Swagger本身的原因还是怎么回事。
如果出现以上的问题可以在“SwaggerConfig” 配置里启用这一行
c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
但只能用一个GET方法
相关文章推荐
- Blending of images, raster operations and basic color adjustments with GDI+
- Teddy's Aspect Weaver Version 0.3 with Great Updating and Fixing, Especially the Implementing of Getting Runtime Method Context Info and Method Arguments in MSIL Level
- Learning C# 2005 : Get Started with C# 2.0 and .NET Programming
- [MSDN]TN035: Using Multiple Resource Files and Header Files with Visual C++
- SHGetSpecialFolderPath 一个很有用的API
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- Verify certificate with OPENSSL and CryptoAPI
- Exposing a WCF Service With Multiple Bindings and Endpoints
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- Exposing a WCF Service With Multiple Bindings and Endpoints
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- API LZCopy And with td1
- Examples of Inherited with and without explicit parent method names
- How-To : Using EJB 3.0 and Java Persistence API with Spring in OC4J
- How To Get Application Path,And How To Get The Path's Directory,File Name,And Type Info(如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息)
- Teddy's Aspect Weaver Version 0.3 with Great Updating and Fixing, Especially the Implementing of Getting Runtime Method Context
- All javaAPI with 例子 in 英文 and a lot more!!!
- Write Auto-Updating Apps with .NET and the Background Intelligent Transfer Service API
- SHGetSpecialFolderPath 一个很有用的API
- is not abstract and does not override abstract method getIncludes() in org.apache.jasper.runtime.HttpJspBase 问题