Skip to content

Support Template Substitutions for URL Segment Versioning #247

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

Closed
commonsensesoftware opened this issue Feb 6, 2018 · 0 comments · Fixed by #252
Closed

Support Template Substitutions for URL Segment Versioning #247

commonsensesoftware opened this issue Feb 6, 2018 · 0 comments · Fixed by #252
Assignees

Comments

@commonsensesoftware
Copy link
Collaborator

Background

The API Explorer correctly discovers API versions described in URL segments as a parameter to an API; however, service authors who use this style of API versioning typically do not want to the parameter to be exposed in tools like Swagger.

The API Explorer normally produces results like:

template: api/v{version}/resource
parameters: [{ name: 'version', defaultValue: '1.0' }]

Service authors that version by URL segment instead prefer:

template: api/v1/resource
parameters: []

Proposal

To support this scenario, the API Explorer should allow a configuration option to trigger this behavior when generating API descriptions. This would include the following features:

  • Trigger opt-in behavior using a new API explorer option (ex: SubstituteApiVersionInUrl)
  • Replace the route parameter in route templates (ex: {version}) with the associated API version
  • Remove the substituted API version parameter from the associated API description
  • Add an option to support the formatting the API version (ex: SubstitutionFormat) based on the supported formatting options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant