Reputation: 26316
I have an asp.net Web API which accepts Enum
from querystring. Swagger doc looks like this:
"parameters": [
{
"name": "granularity",
"in": "query",
"required": true,
"type": "string",
"enum": [
"Hourly",
"Daily",
"Monthly",
"Realtime",
"HourlySecondary",
"DailySecondary",
"MonthlySecondary",
"RealtimeSecondary",
"Weekly",
"WeeklySecondary"
]
}
]
swagger UI generates dropdown with enum values to select like this:
When I use AutoRest to generate C# client SDK, it makes it a string parameter. Is there a way to make it Enum on AutoRest generated client SDK so that those who use my SDK can use Enum instead of having to pass string while calling the API.
Upvotes: 0
Views: 428