最佳答案
您可以启用 XML Comments然后使用 <example>
元素来定义一个例子。这是使用 <example>
的示例:
public class CompanyValidationResponse
{
/// <example>1234</example>
public int CompanyId { get; set; }
/// <example>Damage, Inc</example>
public string CompanyName { get; set; }
}
关于c# - 如何在 asp.net core 的字段中添加 swagger 示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70002577/