Closed yogeshjain999 closed 8 years ago
This feels wrong to me, and I don't want to add this to versionist. If the client is requesting a resource/version that doesn't exist, the client has made an error, and should be notified as such, instead of blindly getting served some other version that may break their response handling.
If it makes sense for your specific use case, I suggest you handle this yourself. Map a catch all not found route at the end of your api_version
block for a specific version, and put logic in the controller method you map this to to figure out what to serve back. See: http://stackoverflow.com/questions/21654826/how-to-rescue-page-not-found-404-in-rails
Good luck.
Will it be convenient to support fallbacking incoming request to previous API version if new version isn't available ?
For example, there is V1 and V2 versions of API. V2 has some of the V1's routes. Now while making a request, developer has to remember which version has which API. One option to overcome this is to inherit all previous API's in new version, but it involves some duplicate code in routes and controller.
But if we can support optional fallbacking, request will be automatically served from previous API if new one isn't available. I'll be happy to look into it if its feasible.