1
我有一個Web API,它返回一個包含字典屬性,如何映射C#字典<int, string>在招搖
public Dictionary<int, string> Roles { get; set; }
我用swashbuckle將其發佈到招搖格式和對象,這是我得到什麼:
"Roles":{"type":"object","additionalProperties":{"type":"string"}}
我不太確定這是正確的嗎?由於沒有跡象表明我的字典鍵是一個整數。
如何正確表示我的字典在swagger格式?