I'm using a fairly standard ASP.NET API MVC template with Swashbuckle, which has been working well to produce Swagger UI documentation.
The API in question already had a few parameters specified as string types rather than a stronger built-in type.
E.g., in a model for Thing
, a person is identified with
public string PersonId { get; set; }
In some cases, the base type works fine. In others I'm able to use an applicable DataType
annotation to get the example to work well.
In the case of data types that aren't included among the DataType
enum options, is there a good way to get Swashbuckle to tell Swagger UI to display something like "a6ba7a43-090d-4945-9be0-dc0bb2211dc0" instead of "string" in the "Example Value" for REST resources using Thing
?