请求主体对象的单个成员的C#swagger文档

请求主体对象的单个成员的C#swagger文档,c#,swagger,asp.net-core-2.1,swashbuckle,C#,Swagger,Asp.net Core 2.1,Swashbuckle,我们正在以以下方式使用///注释编写swagger文档: /// <summary> /// Create a new widget /// </summary> /// <param name="widget"></param> [HttpPost("/create")] [ProducesResponseType(typeof(IPayment), 200)] [ProducesResponseType(typeof(ErrorResult),

我们正在以以下方式使用///注释编写swagger文档:

/// <summary>
/// Create a new widget
/// </summary>
/// <param name="widget"></param>
[HttpPost("/create")]
[ProducesResponseType(typeof(IPayment), 200)]
[ProducesResponseType(typeof(ErrorResult), 400)]
[ProducesResponseType(typeof(ErrorResult), 404)]
public Task<IActionResult> CreateWidget([FromBody] Widget widget)
{
//
///创建一个新的小部件
/// 
/// 
[HttpPost(“/create”)]
[产品响应类型(类型(IPayment),200)]
[产品响应类型(typeof(ErrorResult),400)]
[产品响应类型(typeof(ErrorResult),404)]
公共任务CreateWidget([FromBody]小部件)
{
现在,Widget是IWidget的一个实现,文档的用户应该详细了解Widget/IWidget的每个数据成员的含义、强制、可选和有效值

我们发现,唯一可以添加此描述的地方是

/// <param name="widget">very big multi line description</param>
///非常大的多行描述

虽然这对最终用户有效,但有更好的方法吗?我们问这个问题是因为如果在类/接口定义中内联提供描述,那么它更易于维护。

与使用
//
注释记录操作的方法相同,您也可以记录模型

下面是一个例子:

其代码如下所示:

/// <summary>
/// ## Geographic coordinates
/// ___
/// A **geographic coordinate system** is a coordinate system used in geography that enables every location on Earth
/// </summary>
public class Location
{
    /// <summary>**Latitude**: a geographic coordinate that specifies the north–south position of a point on the Earth's surface.</summary>
    /// <example>25.85</example>
    [Range(-90, 90)]
    public float Lat { get; set; }

    /// <summary>**Longitude**: a geographic coordinate that specifies the east-west position of a point on the Earth's surface.</summary>
    /// <example>-80.27</example>
    [Range(-180, 180)]
    public float Lon { get; set; }
}
//
///##地理坐标
/// ___
///**地理坐标系**是地理中使用的坐标系,它支持地球上的每个位置
/// 
公共类位置
{
///**纬度**:一种地理坐标,用于指定地球表面上某一点的南北位置。
/// 25.85
[范围(-90,90)]
公共浮点Lat{get;set;}
///**经度**:一种地理坐标,用于指定地球表面上一点的东西位置。
/// -80.27
[范围(-180180)]
公共浮点Lon{get;set;}
}