【发布时间】:2021-01-01 07:43:20
【问题描述】:
我在 .net 5 Web API 应用程序中使用 swagger 5.6.3
在控制器中,我使用 DTO 对象
[HttpPost]
public void create([FromForm] CDTO data)
CDTO:
public class CDTO
{
[Required]
public string name { get; set; }
[Required]
public string descrption { get; set; }
[Required]
public IList<KeyValuePair<string, string>> data { get; set; }
}
KeyValuePair 并且没有正确反序列化。有将列表项显示为键值的解决方案吗?
【问题讨论】:
标签: c# .net .net-core swagger swashbuckle