-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow to define the API version where a endpoint is available #2380
Comments
Seems like you'd want version declarations to apply to everything below? It's ... complicated. And having version per API will quickly become messy. I think you should try to use |
Hi @dblock , as always, thanks for the feedback :) Yes, I followed the approach you describe in your post and it perfectly works for what I was trying to achieve 👍 This makes me think that maybe this is a documentation problem (or maybe I was not able to find it?). For example, I discovered that multiple versions were allowed because I checked the code, but not in the README. Do you think #2381 can help? |
doc(#2380): Updating versioning section inside the README
Thanks for contributing the docs! I merged those, closing this issue. |
Hey 👋
I want to share a possible improvement for reusing the same endpoint through different api versions.
I have the v1 of my API that only exposes the
/foo
endpoint.For the next version of my API, I want to add a new endpoint
/var
The examples above results in:
But if i try to access the
/foo
endpoint in my v2 version I'm getting a 404.Taking a look to the code (not present in the documentation), seems I can specify multiple versions if passing an array of values
So now, both endpoints are available under v1 and v2 endpoint.
However, this is not desired behavior. As
/foo
should be available in v2, but/var
should not be present in/v1
.My proposal is to configure each of the endpoints for being available in the different versions of the api. For example, using a
for_versions
method like:And expecting this behavior:
What do you think about this approach?
The text was updated successfully, but these errors were encountered: