Skip to content

Is it psossible to make version selection a dropdown instead of text entry in Swagger? #1088

Discussion options

You must be logged in to vote

Yes - it is possible. In the example project, change the line:

parameter.Schema.Default = OpenApiAnyFactory.CreateFromJson( json );

to

parameter.Schema.Enum = [OpenApiAnyFactory.CreateFromJson( json )];

This will yield the API version as an enumeration.

It should be noted that the documented API may not be representative of all API versions. The model, parameters, and so on may be different across API versions, even if the URL is the same (which it should be). You can use the supported API versions to produce a full list, but realize that this is for the entire API…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by voroninp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants