首页 > 解决方案 > 在 Net Core 3 上为上传的文件添加 Swagger 模式

问题描述

我有这样的动作:

public async Task<IActionResult> Process(IFormFile file)
{
}

我的文件是一个 Json (MyJsonClass)。可以在 Swagger 上显示 MyJsonClass 吗?如何?

谢谢

标签: asp.net-coreswaggerswagger-ui

解决方案


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/


推荐阅读