.NET Core Swagger Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround
遇到的问题
因为新增了一个控制器方法,从而导致在运行Swagger的时候直接报错,异常如下:
SwaggerGeneratorException: Conflicting method/path combination "POST api/UserOperationExample" for actions - WebApi.Controllers.UserOperationExampleController.GetUserInfoByPageList (WebApi),WebApi.Controllers.UserOperationExampleController.AddUserInfo (WebApi). Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround

解决方案
从上面报错的字面描述来看,说的就是对于Swagger/OpenAPI 3.0,Actions需要一个唯一的方法/路径组合,所以我们只需要在每个控制器的Route特性中增加完整的路由即可,如下所示:
[Route("api/[controller]/[action]")]

添加完成后重新运行成功

.NET Core Swagger Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround的更多相关文章
- Actions require unique method/path combination for Swagger
原文:Actions require unique method/path combination for Swagger services.AddSwaggerGen (c => { c.Re ...
- .Net Core Swagger:Actions require an explicit HttpMethod binding for Swagger 2.0
添加完Swagger包引用后运行报错:Actions require an explicit HttpMethod binding for Swagger 2.0 第一时间想到了父类控制器 没有添加 ...
- Ambiguous HTTP method Actions require an explicit HttpMethod binding for Swagger 2.0
异常内容 NotSupportedException: Ambiguous HTTP method for action . Actions require an explicit HttpMetho ...
- C#设计模式总结 C#设计模式(22)——访问者模式(Vistor Pattern) C#设计模式总结 .NET Core launch.json 简介 利用Bootstrap Paginator插件和knockout.js完成分页功能 图片在线裁剪和图片上传总结 循序渐进学.Net Core Web Api开发系列【2】:利用Swagger调试WebApi
C#设计模式总结 一. 设计原则 使用设计模式的根本原因是适应变化,提高代码复用率,使软件更具有可维护性和可扩展性.并且,在进行设计的时候,也需要遵循以下几个原则:单一职责原则.开放封闭原则.里氏代替 ...
- 循序渐进学.Net Core Web Api开发系列【2】:利用Swagger调试WebApi
系列目录 循序渐进学.Net Core Web Api开发系列目录 本系列涉及到的源码下载地址:https://github.com/seabluescn/Blog_WebApi 一.概述 既然前后端 ...
- ASP.NET Core 2.2 WebApi 系列【五】MiniProfiler与Swagger集成
MiniProfiler 是一款性能分析的轻量级程序,可以基于action(request)记录每个阶段的耗时时长,还是可以显示访问数据库时的SQL(支持EF.EF Code First)等 一.安装 ...
- Django2.2报错 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
准备将 Django 连接到 MySQL,在命令行输入命令 python manage.py makemigrations 后报错: django.core.exceptions.Improperly ...
- Django2.2连接mysql数据库出现django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None问题
在使用Django2.2开发的时候,想要使用mysql数据库,在settings.py文件中更改命令: DATABASES = { 'default': { 'ENGINE': 'django.db. ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11
搭建Django2.0+Python3+MySQL5时同步数据库时报错:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 o ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2的最佳处理方法,亲测可用
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2 ...
随机推荐
- Go 基础之基本数据类型
Go 基础之基本数据类型 目录 Go 基础之基本数据类型 一.整型 1.1 平台无关整型 1.1.1 基本概念 1.1.2 分类 有符号整型(int8~int64) 无符号整型(uint8~uint6 ...
- Go 常用命令介绍
Go 常用命令 目录 Go 常用命令 一.Go 常用命令 1.1 go build 1.1.1 指定输出目录 1.1.2 常用环境变量设置编译操作系统和 CPU 架构 1.1.3 查看支持的操作系统和 ...
- bash解释器特性、目录结构、命令种类及优先级、常用命令
bash解释器的交互式环境特性 命令和文件自动补全 注意:Tab只能补全命令和文件及其文件路径 [root@localhost ~]# ls /etc/sysconfig/network-script ...
- bash: accelerate: command not found
py AIGC Stable Diffusion文生图Lora模型微调实现虚拟上装详情 实验手册 实验报告 3. 安装Diffusers 进入PAI-DSW开发环境. 登录PAI控制台. ...
- 累死了qwq-一些平时的思考awa
最近真的有点难受了qwq有的时候没有认可我就是会有点伤心虽然知道就算是全部的人都认可我也没有什么用...但是总归是一个动力的来源.唉有的时候真的好想就这么的放弃信奥啊,毕竟在浙江这种地方,想要那一个奖 ...
- 普冉PY32系列(八) GPIO模拟和硬件SPI方式驱动无线收发芯片XN297LBW
目录 普冉PY32系列(一) PY32F0系列32位Cortex M0+ MCU简介 普冉PY32系列(二) Ubuntu GCC Toolchain和VSCode开发环境 普冉PY32系列(三) P ...
- ELK-WEB中文版化-redis高性能加速
1.ELK-WEB中文汉化版支持:(kibana所在机器执行)Kibana WEB平台所有的字段均显示为英文,目前5.x版本默认没有中文汉化版插件或者汉化包(7.x版本支持汉化默认有汉化),感谢Git ...
- influxdb报错:cache-max-memory-size exceeded
转载请注明出处: influxdb报错日志: 该错误信息表示 InfluxDB 引擎超过了缓存最大内存大小.这意味着 InfluxDB 的缓存使用量超出了配置的限制. 要解决此问题,可以采取以下步骤来 ...
- JAVA异常的不正确处理方式
最近收到一个求助信息,异常堆栈如下: ``` java.lang.RuntimeException: FF1C1005 at test_ssh.sftp.Pool.get(Pool.java:25) ...
- 【日常收支账本】【Day01】用PySide6开发一个记账的小软件——初步构思
软件环境 Python 3.10 超详细Python安装教程 PyCharm Community Edition 2023.2.1 PySide6 6.5.1.1 需求分析 1. 基本要素 个人钱款一 ...