How to give examples with Swashbuckle in swagger for generics

Chu Xu 21 Reputation points
2022-07-27T16:25:32.897+00:00

I have an API that takes generics, eg.
public class ConfigurationDocument<T>
{
/// <summary>
/// Gets or sets the Id of the Configuration document.
/// </summary>
/// <remarks>Id of the Configuration document.</remarks>
/// <example>T-12345678</example>
[JsonProperty(PropertyName = "id", Required = Required.Always)]
public string Id { get; set; }
}

How to make example with real T type, eg. Type1-12345678, Type2-12345678?

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.