Based on the Swagger documentation I must be able to add some examples for my class fields, something like:
But I can't find any way to add these examples to my classes.
You can enable XML Comments and then use the <example>
element to define an example. Here's an example of using <example>
:
public class CompanyValidationResponse
{
/// <example>1234</example>
public int CompanyId { get; set; }
/// <example>Damage, Inc</example>
public string CompanyName { get; set; }
}