I have a C# Web.API project with Swagger and Swashbuckle.
I have a model:
public class TimeZoneName
{
public string zoneName { get; }
}
I have a controller with methods:
public string GetLocalTimeByTimeZone(TimeZoneName timezone)
{
//Stuff Happens here
return "12:00";
}
During a build I was expecting Swashbuckle to generate a SwaggerUI that shows a JSON representation of the TimeZoneName type in the UI.
That didn't occur.
How do I set up my methods and models so that the Model Schema is shown in the SwaggerUI?
If you have a created a new Model, try placing getter and setter methods.
public class MyNewModel
{
public string Member1 {get; set;}
}
Without them the schema is not automatically detected
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With