Skip to content
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 ability to provide custom key name for media type and query string #3

Closed
Weffe opened this issue Feb 25, 2019 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request

Comments

@Weffe
Copy link
Owner

Weffe commented Feb 25, 2019

Currently, the key names used for both Media Type and Query String are hardcoded as v and api-version respectively. It would be ideal to pass the key name in as a config option to withVersioning().

e.g.

For Media Type:

withVersioning(axios, {
  apiVersion: '2',
  versioningStrategy: VersioningStrategy.MediaType
  versionKeyName: 'my-custom-api-version' 
})

For Query String:

withVersioning(axios, {
  apiVersion: '2',
  versioningStrategy: VersioningStrategy.QueryString
  versionKeyName: 'my-custom-api-version' 
})

Maybe keyName can be ignored when the VersioningStrategy is UrlPath.

Something like this: https://codesandbox.io/s/k3j6p446kr?fontsize=14&view=editor

@Weffe Weffe self-assigned this Feb 25, 2019
@Weffe Weffe added the enhancement New feature or request label Feb 25, 2019
@Weffe
Copy link
Owner Author

Weffe commented Feb 26, 2019

Done. Implemented in commit dc3892f

@Weffe Weffe closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant