We have multiple apps running on different frameworks and we are wanting to get the version string in the Accept header to be consistent across the apps.
For instance we have a hapi app that looks for an Accept header like the following: application/vnd.myapi.v2+json
And we have a rails app that is looking for an Accept header like the following: application/vnd.myapi+json; version=2
To accomplish this we were thinking we could add the option to pass an extractVersionFromAcceptHeader function in the options. If this function is passed it will be run instead of the built in _extractVersionFromAcceptHeader function. This would give us the most flexibility on how the version is passed in the Accept header.
I'm going to work on making the modifications, but wanted to get your thoughts as well
We have multiple apps running on different frameworks and we are wanting to get the version string in the Accept header to be consistent across the apps.
For instance we have a hapi app that looks for an Accept header like the following:
application/vnd.myapi.v2+json
And we have a rails app that is looking for an Accept header like the following:
application/vnd.myapi+json; version=2
To accomplish this we were thinking we could add the option to pass an
extractVersionFromAcceptHeader
function in the options. If this function is passed it will be run instead of the built in_extractVersionFromAcceptHeader
function. This would give us the most flexibility on how the version is passed in the Accept header.I'm going to work on making the modifications, but wanted to get your thoughts as well