• ABP Swagger 支持方法重载


    原文:
    https://www.cnblogs.com/asd14828/p/11136837.html

    报错

    ERROR 2020-10-16 11:31:20,598 [10   ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HM3HGFH7B4U2", Request id "0HM3HGFH7B4U2:00000003": An unhandled exception was thrown by the application.
    System.NotSupportedException: HTTP method "POST" & path "api/services/app/ExcelImport/ExcelToDataSet" overloaded by actions - BIMMP.DataImporting.ExcelImport.ExcelToDataSet (BIMMP.Application),BIMMP.DataImporting.ExcelImport.ExcelToDataSet (BIMMP.Application). Actions require unique method/path combination for Swagger 2.0. Use ConflictingActionsResolver as a workaround
       at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable`1 apiDescriptions, ISchemaRegistry schemaRegistry)
       at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
       at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItems(IEnumerable`1 apiDescriptions, ISchemaRegistry schemaRegistry)
       at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath, String[] schemes)
       at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
       at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
       at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
       at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext) in D:GithubaspnetboilerplatesrcAbp.AspNetCoreAspNetCoreSecurityAbpSecurityHeadersMiddleware.cs:line 26
       at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
       at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
    

    解决

                services.AddSwaggerGen(c =>
                {
                    c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
                });
    
  • 相关阅读:
    v-charts 绘制柱状图、条形图、水球图、雷达图、折线图+柱状图,附官网地址
    vue-cli3 assets目录下的SASS文件中添加背景图片报错Module not found: Error: Can't resolve './@/assets/images/login.png'解决办法
    Vue UI 框架(pc、移动端)
    单页面应用 VS 多页面应用
    DOM重点核心总结
    JS之三种动态创建元素的区别
    DOM节点操作
    自定义属性
    CSS面试题
    CSS中定义变量,并使用变量设置属性值
  • 原文地址:https://www.cnblogs.com/guxingy/p/13825624.html
Copyright © 2020-2023  润新知