I'am trying to add the format and/or pattern keywords in my Swagger documentation. I'am using Swashbuckle and currenlty I'am using XML Comments to insert descriptions for my different fields. For example: The controller:
/// <summary>
/// Shows a list with states
/// </summary>
/// <param name="id">The state ID</param>
/// <returns>Offers the state</returns>
[HttpGet("id", Name = "Get")]
public async Task<ActionResult<State>> GetState(string id)
{
State result = GetState(id);
return Ok(result);
}
I want the swagger documentation to show the pattern keyword with the regex expression:
'^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$'
Is it possible to add this documentation while using XML comments or annotations. I'd like to ask the same for the format keyword. For example: 'format: date-time'
Are these things possible using XML comments or annotations with Swashbuckle to auto generate Swagger documentation or would this require a static swagger file?