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
API versioning #127
Comments
That is an valid and interesting problem since we have more than one author for the API.
So we would need a versioning scheme in the URL like:
That kind of looks ugly... any other thoughts on this? |
Agree this looks ugly! It's also unusual, and I can't recall seeing a single example of this anywhere else. I think I would find this unacceptable, and I suspect many of our users would too. This would mean that once we hit our 1.0 release, we're going to have to ensure that the API that we're in control of doesn't change in a back-incompatible way. This shouldn't be too hard, since I think this part of the API is read-only. We will just have to ensure that we don't remove any data from it. |
I agree that we have to have the ability to set the API as a project. I disagree that once we hit our 1.0 release we have to make the API doesn't change in a backwards compatible way. Why not?
Okay then, as for versioning schemes, assuming: class BlogAdmin(ModelAdmin2):
version = 2
I'm not sure there is a good way to handle this so I think we'll have to deal with the worst of all evils. 🐸 |
Maybe we shouldn't take too much effort to push all the available API resources into one endpoint. It might be easier and more logical for each
The generic entrypoint at
|
@gregmuellegger - I like this approach. Let's do it. If we have to change it later for some unanticipated reason, we shall. |
I prefer this approach but I will leave another option I was reading about just in case. Http-Headers to select between the different backwards-incompatible endpoints Pros: Cons: PD: This is how Stripe API currently manages versioning https://stripe.com/docs/api#versioning |
@paurosello That's an interesting idea but I think we'll go with @gregmuellegger's approach. 💇 |
Hey @gregmuellegger, can we close this ticket? |
In
docs/api.rst
we imply that the API version number will change when admin2 changes. However, I think this is backwards: it should be the responsibility of the user admin2 to update the version number, since they might want to change the API that they expose to their end users.As such, we'll need to provide a mechanism for a user to associate a ModelAdmin2 with an API version.
This might look like:
This version attribute would then be used to construct the URLs.
Thoughts?
The text was updated successfully, but these errors were encountered: