swagger--Failed to load API definition.

打开
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.的更多相关文章
- swagger Failed to load Api definition 的问题
这个问题是由于Tomcat乱码问题导致的,修改server.xml文件的编码格式修改成UTF-8
- Swagger使用的时候报错:Failed to load API definition
NuGet添加Swashbuckle.AspNetCore,在Startup.cs添加和启用中间件Swagger public void ConfigureServices(IServiceColle ...
- Abp的swagger UI 出现Failed to load API definition.
Abp 出现Failed to load API definition.如下图: 原因:本次出现的原因是Api里面的方法重名了(只是方法的参数不一样)(可能是controller中的auction上面 ...
- 集成JUnit测试错误java.lang.IllegalStateException: Failed to load ApplicationContext
1 详细错误信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.t ...
- Spring3.x 版本和 JDK1.8 不兼容导致 java.lang.IllegalStateException: Failed to load ApplicationContext
由于安装了 JDK1.8 的版本,最近在进行整合 Struts2+Spring+Hibernate 框架的时候,不小心导入了之前下载的 Spring 3.2.0 版本的 jar 包. 结果在运行测试用 ...
- 【Hibernate】Hibernate3.x独立执行时的Failed to load class "org.slf4j.impl.StaticLoggerBinder"错误
按理说,假设Hibernate不依附于SSH执行,像<[Struts2+Hibernate3+Spring3]利用SSH整合,完毕打印用户表,用户登录.注冊.改动password系统>(点 ...
- 关于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 ...
- Eclipse启动的时候提示:Failed to load JavaHL Library
版本信息: Eclipse Project Release Notes Release 4.7.3 启动提示: Subclipse talks to Subversion via a Java API ...
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx错误解决方法
在开发项目的过程中,和后端对接,我们使用是一个成熟的集成很全面的架构JHipster.后端为java spring-boot 前端ts+react,需求是有一个需要在页面里嵌套iframe的需求.然后 ...
随机推荐
- Jmeter简单性能测试练习
项目描述: 被测网站:xqtesting.blog.51cto.com 指标:响应时间以及错误率 场景:线程数20 测试步骤: 测试计划 线程组 http请求 监听器 运行脚本 查看报告 1.添加 ...
- R的安装以及包安装
今天看论文,需要用到R语言的库,于是又折腾了半天.. 其实并没有什么太大的问题,只是在第三方包的下载方面还有python中使用R方面遇到了问题: 第三方包的导入 其实在网上有 ...
- tpcc-mysql 试用
percona 出的一个mysql压力测试工具,至于tpcc的话,是一个衡量事务处理能力的一个值.具体可以看老外对他的定义. http://www.tpc.org/tpcc/results/tpcc_ ...
- 数据结构----链表Link
链表简介与数据结构 单向链表也叫单链表,是表中最简单的一种形式,它的每个节点包含两个域,一个信息域(元素域)和一个链接域.这个链接指向链表中的下一个节点,而最后一个节点的链接域则指向一个空值. 单向链 ...
- nginx之启停操作及配置文件语法检测
nginx的启停操作 ----nginx 启动 ----nginx -s stop 停止 ----nginx -s reload 重新加载 nginx -t 修改配置文件之后进行语法检验
- Django模板之模板标签
标签比变量更加复杂:一些在输出中创建文本,一些通过循环或逻辑来控制流程,一些加载其后的变量将使用到的额外信息到模版中. 一些标签需要开始和结束标签 (例如:{% tag %} ...标签 内容 ... ...
- codis原理及部署_01
一.codis介绍 Codis是一个分布式Redis解决方案,对于上层的应用来说,连接到Codis Proxy和连接原生的RedisServer没有明显的区别,有部分命令不支持 Codis底层会处理请 ...
- EventBus/EventQueue 再思考
EventBus/EventQueue 再思考 Intro 之前写过两篇文章,造轮子系列的 EventBus/EventQueue,回想起来觉得当前的想法有点问题,当时对 EvenStore 可能有点 ...
- SQL Server存储过程模拟HTTP请求POST和GET协议
/****** Object: StoredProcedure [dbo].[sp_http_get] Script Date: 05/23/2020 15:47:09 ******/ SET ANS ...
- java类的方法的使用
类的方法:提供某种功能的实现: 实例:public void eat (){ } public String getName(){ } public void setName(String n){ ...