hug icon indicating copy to clipboard operation
hug copied to clipboard

Hug Option to select the default API version

Open alcalda opened this issue 7 years ago • 3 comments

When using the keyword "versions" on hug decorators, a request without the prefix v# (selecting a specific version) the highest API version is presented by default.

When introducing a new API version it would be useful when a running server could work seamlessly with a dedicated API version number, rather than selecting to newest one automatically.

alcalda avatar Feb 06 '18 19:02 alcalda

I think I understand what you want, /users should return /v2/users even if you have a version 3?

But why?

hvgab avatar Sep 30 '18 00:09 hvgab

If an API is being updated, but the Default (old) behaviour, when no specific API version number is contained in the url, shall still be used for a period of time.

Von: Gabbeh Gesendet: Sonntag, 30. September 2018 02:46 An: timothycrosley/hug Cc: alcalda; Author Betreff: Re: [timothycrosley/hug] Hug Option to select the default API version(#619)

I think I understand what you want, /users should return /v2/users even if you have a version 3? But why? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

alcalda avatar Oct 01 '18 19:10 alcalda

I think I understand what you want, /users should return /v2/users even if you have a version 3?

But why?

I am not sure but I think he meant that if you have specified f.e. versions 1 and 2 than

/v1/users should invoke v1 code /v2/users should invoke v2 code /users should invoke v2 code - as it is the newest.

Or if something like default_version will be specified explicitly then /users should invoke default_version code

I think this could be a useful feature. I would definitely use it.

@timothycrosley - Do you think it is worth developing ? I can prepare a PR if it is something you would want in hug.

JanTkacik avatar Feb 08 '19 14:02 JanTkacik