Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not supported by Swagger 2.0: Multiple operations with path 'v1/api/Admin/' and method 'POST'. #916

Closed
stricq opened this issue Oct 29, 2016 · 3 comments

Comments

@stricq
Copy link

stricq commented Oct 29, 2016

I installed Swashbuckle v5.5.2 in a new Web.API project that is .Net 4.6.1. With no controllers, it worked with no errors. However, after I added a controller with a Get and a Put method, I get the following error in Swashbuckle:

500 : {
"Message": "An error has occurred.",
"ExceptionMessage": "Not supported by Swagger 2.0: Multiple operations with path 'v1/api/Admin/' and method 'POST'. See the config setting - "ResolveConflictingActions" for a potential workaround",
"ExceptionType": "System.NotSupportedException",
"StackTrace": " at Swashbuckle.Swagger.SwaggerGeneratorOptions.DefaultConflictingActionsResolver(IEnumerable1 apiDescriptions)\r\n at Swashbuckle.Swagger.SwaggerGenerator.CreatePathItem(IEnumerable1 apiDescriptions, SchemaRegistry schemaRegistry)\r\n at Swashbuckle.Swagger.SwaggerGenerator.<>c__DisplayClass7.b__4(IGrouping2 group)\r\n at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer`1 comparer)\r\n at Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\r\n at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.HttpServer.d__0.MoveNext()"
}
http://localhost:20923/swagger/docs/v1

The problem is, there is no Admin controller anywhere in the project. The controller I added does not have any POST methods at all.

@stricq
Copy link
Author

stricq commented Oct 29, 2016

I found the controller. It was coming from RavenDB DLLs.

@stricq stricq closed this as completed Oct 29, 2016
@kdcllc
Copy link

kdcllc commented Jul 5, 2017

@stricq How did you filter the RavenDB DLls? I am experiencing the same kind of issue.

I used this to resolve the issue: #142 (comment)

Thanks, kdcllc

@stricq
Copy link
Author

stricq commented Jul 6, 2017

I uncommented the ResolveConflictingActions line in the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants