asp.net-core - 在 Net Core 3 上为上传的文件添加 Swagger 模式
问题描述
我有这样的动作:
public async Task<IActionResult> Process(IFormFile file)
{
}
我的文件是一个 Json (MyJsonClass)。可以在 Swagger 上显示 MyJsonClass 吗?如何?
谢谢
解决方案
Here is a good post that explains your need solution, although it is not done with a .json file.
https://mattfrear.com/2015/04/21/generating-swagger-example-responses-with-swashbuckle/
推荐阅读
- eclipse-plugin - STS 是否支持 spring 集成插件来查看集成流程?
- javascript - 如何正确检索 JQuery 中的值?
- c - 指向整数数组的指针与指向整数的双精度指针
- javascript - 按钮 Onclick 函数在加载时执行
- laravel-5 - VueJS:尽管数组中有对象,但 v-for 指令不渲染项目
- javascript - 提交通过推送器显示的实时表单时出现 419
- reactjs - 使用 React 中的 Axios 发出 http 请求以表达在预飞行后因 CORS 错误而失败。在服务器上启用了 CORS,但仍然无法正常工作
- regex - 匹配直到符号第一次出现
- reactjs - getDerivedStateFromError 后重置状态
- ios - UITextField 没有在 UIStackView 中归档可用宽度