here my model for registration and set comments for example but its still not show in swagger its display somehing like this { userName:"string" }
instead of { userName:"Jasmin" }
public class RegisterViewModel
{
/// <summary>
/// Name of the user
/// </summary>
/// <example>Jasmin</example>
[Required]
[Display(Name = "Name")]
public string UserName { get; set; }
/// <summary>
/// User Contact Number
/// </summary>
/// <example>9033156314</example>
[Required]
[Phone]
[Display(Name = "PhoneNumber")]
public string ContactNumber { get; set; }
/// <summary>
/// User Device Id
/// </summary>
/// <example>12364457tryhret1223</example>
[Required]
public string DeviceId { get; set; }
/// <summary>
/// User Device Info
/// </summary>
/// <example>Jasmin</example>
[Required]
public string DeviceInfo { get; set; }
}
and my method is below
/// <summary>
/// Register User Through Contact Number.
/// </summary>
[HttpPost]
[AllowAnonymous]
public async Task<IActionResult> Register([FromBody]RegisterViewModel model)
{
}
but example is not shown in swagger