打开

http://localhost:5000/swagger/v1/swagger.json

提示错误

An unhandled exception occurred while processing the request.
NotSupportedException: HTTP method "GET" & path "api/Report/ExportUserRegisterData" overloaded by actions - XXX.Application.Report.ReportApplication.ExportUserRegisterData (XXX.Application),XXX.Application.Report.ReportApplication.ExportUserRegisterData (XXX.Application). Actions require unique method/path combination for Swagger 2.0. Use ConflictingActionsResolver as a workaround
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable<ApiDescription> apiDescriptions, ISchemaRegistry schemaRegistry)

原因

有Get类型的重载的接口方法

解决方法

options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());

意思是swagger只会取其中一个Action

具体位置

//自动生成Api文档
services.AddSwaggerGen(options =>
{
options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
});

swagger--Failed to load API definition.的更多相关文章

  1. swagger Failed to load Api definition 的问题

    这个问题是由于Tomcat乱码问题导致的,修改server.xml文件的编码格式修改成UTF-8

  2. Swagger使用的时候报错:Failed to load API definition

    NuGet添加Swashbuckle.AspNetCore,在Startup.cs添加和启用中间件Swagger public void ConfigureServices(IServiceColle ...

  3. Abp的swagger UI 出现Failed to load API definition.

    Abp 出现Failed to load API definition.如下图: 原因:本次出现的原因是Api里面的方法重名了(只是方法的参数不一样)(可能是controller中的auction上面 ...

  4. 集成JUnit测试错误java.lang.IllegalStateException: Failed to load ApplicationContext

    1 详细错误信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.t ...

  5. Spring3.x 版本和 JDK1.8 不兼容导致 java.lang.IllegalStateException: Failed to load ApplicationContext

    由于安装了 JDK1.8 的版本,最近在进行整合 Struts2+Spring+Hibernate 框架的时候,不小心导入了之前下载的 Spring 3.2.0 版本的 jar 包. 结果在运行测试用 ...

  6. 【Hibernate】Hibernate3.x独立执行时的Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder&quot;错误

    按理说,假设Hibernate不依附于SSH执行,像<[Struts2+Hibernate3+Spring3]利用SSH整合,完毕打印用户表,用户登录.注冊.改动password系统>(点 ...

  7. 关于spring boot在启动的时候报错: java.lang.Error: generate operation swagger failed, xxx.xxx.xxx

    Error starting ApplicationContext. To display the auto-configuration report re-run your application ...

  8. Eclipse启动的时候提示:Failed to load JavaHL Library

    版本信息: Eclipse Project Release Notes Release 4.7.3 启动提示: Subclipse talks to Subversion via a Java API ...

  9. NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx错误解决方法

    在开发项目的过程中,和后端对接,我们使用是一个成熟的集成很全面的架构JHipster.后端为java spring-boot 前端ts+react,需求是有一个需要在页面里嵌套iframe的需求.然后 ...

随机推荐

  1. Visual C++ 6.0(完整绿色版)的下载、安装和破解(图解)

    vc工具的下载 链接: https://pan.baidu.com/s/1GTkcWjureiZS_2WL2dvrMw 提取码: 5859 首先点击链接下载好压缩包并解压 这里是解压好滴文件目录 双击 ...

  2. pyppteer下

    目录 启动pyppteer 切图 获取响应头,响应头状态,cookies 获取当前页面标题 获取页面html 第一种:获取整个页面html 第二种:只获取文本 注入JS,控制上下滚动 选择器 获取元素 ...

  3. node的fs模块

    node的file system模块提供的api有同步和异步两种模式(大多数情况下都是用的异步方法,毕竟异步是node的特色,至于提供同步方法,可能应用程序复杂的时候有些场景使用同步会比较合适).异步 ...

  4. centos7 git下载速度慢

    nslookup命令 yum -y install bind-utils [root@iZ1i4qd6oynml0Z ~]# nslookup github.global.ssl.fastly.Net ...

  5. 4.2 Go switch

    4.2 Go switch switch语句用于基于不同条件执行不同动作,每一个case分支唯一,自上而下逐一测试,直到匹配结束,默认自动终止,不需要break. 2. switch基本语法 swit ...

  6. Redis-主从

    主从复制过程 1.从服务器开始连接主服务器时,会向主服务器发送一个SYNC同步命令 2.主服务器接收到命令后,执行BGSAVE,异步的将写命令保存到一个缓冲区里 3.主服务器执行完BGSAVE之后,就 ...

  7. ABAP基础4:模块化

    子程序定义 以form开始,以endform结束,用perform语句调用,from语句可以在程序内部/外部,perform一定要写在前面 perform. from. 子程序模块 endform. ...

  8. Java并发编程3-抽象同步队列AQS详解

    AQS是AtractQueuedSynchronizer(队列同步器)的简写,是用来构建锁或其他同步组件的基础框架.主要通过一个int类型的state来表示同步状态,内部有一个FIFO的同步队列来实现 ...

  9. poj1486二分匹配 待填坑

    Sorting Slides Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4777   Accepted: 1867 De ...

  10. vue使用stylus样式预处理器

    vue使用stylus样式预处理器,样式总是报错,需要从上一行的样式回车换行才不会报错 <style lang="stylus" scoped> .navbar mar ...