Swagger使用--在一个Controller中使用相同(类似)参数的方法
解决方法:在Startup.cs中加入CustomSchemaIds
// Register the Swagger generator, defining 1 or more Swagger documents
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new Info { Title = "CompareAPI", Version = "v1" });
c.CustomSchemaIds((type) => type.FullName);//根据全名来生成
});
控制器代码类似:
[Route("api/[controller]")]
[ApiController]
public class AccountController : ControllerBase
{
[HttpPost]
[Route("Register")]
public async Task<ActionResult<T>> Register(RegisterModel registerModel)
{
}
[HttpPost]
[Route("ResetPassword")]
public async Task<ActionResult<T>> ResetPassword(ResetPasswordModel resetPasswordModel)
{
}
}
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/README.md#customize-schema-ids
Swagger使用--在一个Controller中使用相同(类似)参数的方法的更多相关文章
- jsp中四种传递参数的方法
jsp中四种传递参数的方法如下: 1.form表单 2.request.setAttribute();和request.getAttribute(); 3.超链接:<a herf="i ...
- php 中函数获取可变参数的方法, 这个语法有点像 golang 语言中的
原文呢:http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration.strict Onl ...
- Extjs中给同一个GridPanel中的事件添加参数的方法
Extjs中给同一个GridPanel中的事件添加参数的方法: this.isUse = new Ext.Action({ text:'启用', scope ...
- Mybatis中传递多个参数的方法总结
一.单个参数: public List<XXBean> getXXBeanList(String xxCode); <select id="getXXXBeanList&q ...
- flask中获取request的参数的方法
request请求总体分为两类: 1.get请求 访问时会在地址栏直接显示参数不安全,且参数大小比较小. 2.post请求 参数不显示在地址栏,一般用户注册.登录都通过post请求完成. flask获 ...
- 关于swagger——WebApi一个controller中出现多个Get是出现错误的处理
如 /// <summary> /// 测试处理 /// </summary> public class TestController : ApiController { // ...
- (转)JSP中四种传递参数的方法:
1.form表单 2.request.setAttribute();和request.getAttribute(); 3.超链接:<a herf="index.jsp"?a= ...
- jQuery从主页面存取控制 iframe 中的元素,参数及方法
从主页面上获取iframe下的某个对象,或使用iframe下的方法,或是获取iframe下某个doc元素,要求兼容各类浏览器,不仅仅ie; $(function() { $('#abgne_ifram ...
- flask中request对象获取参数的方法
从当前request获取内容: method: 起始行,元数据 host: 起始行,元数据 path: 起始行,元数据 environ: 其中的 SERVER_PROTOCOL 是起始行,元数据 he ...
随机推荐
- Java字节流文件封装
/** * 字节流封装方法 */ import java.io.FileInputStream; import java.io.FileNotFoundException; import jav ...
- python 爬虫 目录
爬虫 介绍 python 爬虫 urllib模块 python 爬虫 requests模块
- Linux里添加用户的一些简单命令
普通用户---------普通用户对应提示符$ 超级用户-----------超级用户对应提示符# 1.添加用户:useradd diqi 2.查看用户:tail -1 /etc/passwd 3.设 ...
- JAVA基础--JAVA API集合框架
一.Map集合 1. map集合介绍 Collection集合的特点: 集合中存储的所有元素都是单一元素,元素和元素之间没有必然的关系.因此我们把Collection集合也称为单列集合. Map集合: ...
- Known Notation括号匹配类问题(2014年ACM/ICPC 亚洲区域赛牡丹江)
题意: 给你数字或 * 的串,你可以交换一个*和数字.在最前面添1.在一个地方插入*,问你使串满足入栈出栈的(RNP)运算法则. 思路: 引用:https://blog.csdn.net/u01158 ...
- 01:gitbook使用
1.1 gitbook介绍 1.gitbook说明 GitBook 使用的markdown语法 在此基础上做了一些 写作便利性的加强 Markdown 是一种轻量级的「标记语言」,优点在于 专注你的文 ...
- 使用Keras基于AdvancedEAST的场景图像文本检测
Blog:https://blog.csdn.net/linchuhai/article/details/84677249 GitHub:https://github.com/huoyijie/Adv ...
- C语言实现远程代码注入
#include <windows.h> #include <iostream> #define STRLEN 20 typedef struct _DATA { DWORD ...
- angular 4+中关于父子组件传值的示例
home.component.ts import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-hom ...
- O003、准备 KVM 实验环境
参考https://www.cnblogs.com/CloudMan6/p/5240770.html KVM 是 OpenStack 使用的最广泛的Hypervisor,本节介绍如何搭建 KVM ...