Skip to content

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

Merged
merged 17 commits into from
Apr 14, 2017

Conversation

commonsensesoftware
Copy link
Collaborator

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.

/// <summary>
/// Represents the Swagger/Swashbuckle operation filter used to document the implicit API version parameter.
/// </summary>
public class ImplicitApiVersionParameter : IOperationFilter

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?

Copy link
Collaborator Author

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 )

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

@commonsensesoftware commonsensesoftware merged commit 97f8071 into master Apr 14, 2017
@commonsensesoftware commonsensesoftware deleted the dev/chrimart/implement-api-explorer branch April 17, 2017 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants