【发布时间】:2016-05-12 19:00:26
【问题描述】:
有没有办法在 swagger 输出中添加模型信息,例如有效值、默认值、摘要和其他备注?
例如在 c# 中,我如何将以下 cmets 和属性添加到 swagger 中?
/// <summary>
/// A clear summary
/// </summary>
/// <remarks>
/// Some remarks
/// </remarks>
public class A
{
public A()
{
_Field_A = 0;
_Field_B = string.Empty;
}
private int _Field_A { get; set; }
[Range(0, 150)]
public int Field_A
{
get
{
return _Field_A;
}
set
{
if (value != null) { _Field_A = value; }
}
}
private string _Field_B { get; set; }
/// <summary>
/// Field_B summary
/// </summary>
public string Field_B
{
get
{
return _Field_B;
}
set
{
if (value != null) { _Field_B = value; }
}
}
}
【问题讨论】:
标签: c# swagger swashbuckle