.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 ...
随机推荐
- 其它——Redis与Mysql双写一致性方案解析
文章目录 一 前言 二 一致性方案 三 先更新数据库,再更新缓存 四 先删缓存,再更新数据库 五 先更新数据库,再删缓存 一 前言 首先,缓存由于其高并发和高性能的特性,已经在项目中被广泛使用.在读取 ...
- Flask框架——Flask脚本、flask知识点补充
文章目录 Flask_脚本 1 集成Python shell 1.1 flask-script的用法: 1.1.1 实例:flask-script的简单实现 1.1.1命令添加方式: 第一种(无参命令 ...
- JDK21的虚拟线程是什么?和平台线程什么关系?
虚拟线程(Virtual Thread)是 JDK 而不是 OS 实现的轻量级线程(Lightweight Process,LWP),由 JVM 调度.许多虚拟线程共享同一个操作系统线程,虚拟线程的数 ...
- 再学Blazor——组件
Blazor 应用基于组件,组件可以复用和嵌套.本文内容如下: 组件类 组件嵌套 组件参数 组件对象 1. 组件类 所有组件都是继承 ComponentBase 组件基类,razor 文件默认继承 C ...
- SSH简述
远程访问及控制 1.SSH 1.1 简单介绍 SSH协议(secure shell) 是一种安全通道协议 对数据进行加密处理,用于远程管理 OpenSSH(安装包名,centos7自带) 服务名称:s ...
- answer_to_everything
题解,第一次遇到这种题目纪念一下 攻防世界逆向入门题之answer_to_everything_沐一 · 林的博客-CSDN博客
- String 的 indexOf 与 search 方便的区别
String 这个对象里面包含许多方法 今天只要讲 indexOf 与 search 1.indexOf stringObject.indexOf(searchvalue,fromindex) 2.s ...
- 【PySide6】QChart笔记(三)—— QPieSeries的使用
一.QPieSeries简介 1. 官方描述 https://doc.qt.io/qtforpython-6/PySide6/QtCharts/QPieSeries.html 一个饼图序列(QPieS ...
- 【随手记录】Llama Tutorial 大语言模型实践
这个tutorial的契机是yy突然看到了一个workshop 所以类似于一周大作业的形式,输入command输出使用了自动驾驶哪些模块,代码在这里 所以就干一干,顺便写一个tutorial给大家参考 ...
- CentOS 7替换默认软件源
安装CentOS 7后,默认源在国外,可以替换为国内的源以提升访问速度 参考https://mirrors.ustc.edu.cn/help/centos.html sudo vi /etc/yum. ...