-
Notifications
You must be signed in to change notification settings - Fork 712
Add Support for IApiExplorer #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for IApiExplorer #103
Conversation
/// <summary> | ||
/// Represents the Swagger/Swashbuckle operation filter used to document the implicit API version parameter. | ||
/// </summary> | ||
public class ImplicitApiVersionParameter : IOperationFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used here for query string case only, isn't it?
And for version in path case I have to use SetVersionInPath filter, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my comments weren't clear enough, but this particular filter handles both query string and URL path segment. Most service authors need one or the other. I wanted to show both working without creating another sample application.
In the URL path segment scenario, the only thing you need to do is assign the Default property. This will fill in the current version API so that you can use the Try It! feature. In the query string scenario, you have to add an implicit parameter that isn't formally declared in your controller actions. This would also be the case for versioning by header.
} | ||
} | ||
|
||
static Info CreateInfoForApiVersion( ApiVersionDescription description ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be made as local function as it does not used elsewhere
…query string and URL path methods in samples
…ggregated API versions might not be reported correctly
This contains the first reviewable set of changes to enable IApiExplorer for API-versioned services in ASP.NET Web API. The next iteration will contain support for ASP.NET Core.