Closed yiyungent closed 2 years ago
SwaggerGeneratorException: Ambiguous HTTP method for action - PluginCore.Controllers.AppCenterController.Plugins (PluginCore). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0 Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable<ApiDescription> apiDescriptions, SchemaRepository schemaRepository) Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable<ApiDescription> apiDescriptions, SchemaRepository schemaRepository) Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(string documentName, string host, string basePath) Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
若 PluginCore + Swashbuckle.AspNetCore 配合使用就容易导致此错误,需要给 PluginCore.Controllers.AppCenterController.Plugins 打上 HTTP 特性
PluginCore
Swashbuckle.AspNetCore
PluginCore.Controllers.AppCenterController.Plugins