-
Notifications
You must be signed in to change notification settings - Fork 300
revert JSONAPI prefix to JsonApi for paginators. #469
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
revert JSONAPI prefix to JsonApi for paginators. #469
Conversation
Not sure it's needed, but the docmentation says to do it.
- allow the example app to still run, just failing any JSONAPIDjangoFilter tests. - split the two filters into separate files for easier maintenance.
- Had a mistake (unquoted '.') and missing '-' as an allowed character. Also '_' already in '\w' - Don't be so exhaustive in testing for invalid filters; let JSONAPIQueryValidationFilter (when available) deal with that.
Per discussion about naming, the idea is that it should be easy to updgrade from DRF to DJA by simply changing some imports, retaining the same DRF (or in this case, django-filter) class names that are extended by DJA. see django-json-api#467 (comment)
…for consistency (django-json-api#463)" This reverts commit e6290af.
- see django-json-api#467 (comment) - JSONAPIPageNumberPagination goes back to PageNumberPagination - JSONAPILimitOffsetPagination goas back to LimitOffsetPagination - requires new setting: `JSON_API_STANDARD_PAGINATION=True` to get `page[number]` and `page[size]` instead of `page` and `page_size`. This is a breaking change no matter which is the default value.
Let's try to follow common practices concerning deprecation and versioning. I haven't had the time to document this but I think as DJA we should follow Semver and implement a similar deprecation policy like Ember (which is most likely the most used JS framework with JSON API spec). This way we have a simple migration guide for our users. We can simply say, upgrade to the latest minor version of a series (e.g. 2.6.0) and solve all deprecation warnings. In version 3.0.0 we simply remove all deprecation warnings and do nothing else (real changes follow then in a version 3.1.0 etc.). What this mean for our pagination:
This way we do not have to introduce a new arbitrary setting and have a simple migration guide for our DJA users. What do you think? |
I was assuming we were following semver. Since 2.5.0 released Restating what you said, In addition we should add deprecation warnings now (presumably for a forthcoming 2.6.0 release) that indicate that in 3.0 or 3.1:
I can revert the Do you agree? |
This sounds good. 👍 |
We've decided to stick with JsonApi (as found in release 2.5.0) as the paginator prefix for now. This reverts commit 00dcf52.
(as is in release 2.5.0). Will replace without the JsonApi prefix in release 3.0. Deprecation warnings added.
@@ -0,0 +1,123 @@ | |||
import re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was added here by mistake. removing in next commit.
@sliverc This is ready for your review. I especially look forward to your thoughts regarding making a "promise" for future deprecations in release 3.0. |
- for renaming paginators without JsonApi prefix - for changes to attribute defaults
@sliverc I think I've done the PendingDeprecationWarnings correctly using |
Thanks. The deprecation warnings look good now. I tried to put myself into the shoes of an user and have a feeling they won't understand why they have to implement custom classes. We would certainly not recommend for them to do it unless they use the old parameters To simplify the upgrade procedure for an existing user I think we should at this point not deprecate In the next release we will then deprecate Much cleaner for a user to understand what is happening. Also how to solve deprecation needs to be part of the CHANGELOG and not hidden in the documentation. I haven't written any detailed review because I think there might be a bit too many back and forth. Is it OK if I push to this PR? Would be more efficient and then you can look whether you agree with the changes. |
@sliverc: Yes. Please do.
…On Mon, Sep 10, 2018 at 8:38 AM Oliver Sauder ***@***.***> wrote:
Thanks. The deprecation warnings look good now.
I tried to put myself into the shoes of an user and have a feeling they
won't understand why they have to implement custom classes. We would
certainly not recommend for them to do it unless they use the old
parameters page and page_number.
To simplify the upgrade procedure for an existing user I think we should
at this point not deprecate JsonApiPageNumberPagination. This way the
documentation can state to move to JsonApiPageNumberPagination. Only if
someone wants to keep the old parameters do they need to implement their
custom pagination.
In the next release we will then deprecate JsonApiPageNumberPagination
and say to move to PageNumberPagination.
Much cleaner for a user to understand what is happening.
Also how to solve deprecation needs to be part of the CHANGELOG and not
hidden in the documentation.
I haven't written any detailed review because I think there might be a bit
too many back and forth. Is it OK if I push to this PR? Would be more
efficient and then you can look whether you agree with the changes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#469 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEJ5d0CZGSP3BEw5xdsaSYB1ORP7DIJDks5uZl0_gaJpZM4WUZik>
.
|
a781c13
to
1c810c0
Compare
@n2ygk I have adjusted the code and clarified changelog how to migrate. Does it look ok to you? Do you see anything else which we need to do before releasing 2.6.0? Otherwise would I suggest we do a release and just short after follow up with a 3.0.0 release where we remove all deprecation warnings and deprecate JsonApiPageNumberPagination and JsonApiLimitOffsetPagination + changing defaults of PageNumberPaginiation and LimitOffsetPagination. P.S. |
@sliverc This looks good and ready for you to squash merge. Before a 2.6.0 release, please let me submit two more PRs:
I will want to get to some new exception classes that properly format the errors object but that can wait. |
Thanks. Merged. I would prefer that we don't wait for a release concerning point 1. This can be added as fully backwards compatible change at any time later one. Point 2 makes certainly sense to document before a release. |
Fixes #471
Description of the Change
Reverts JSONAPI prefix to JsonApi prefix on paginators as in release 2.5.0. Will replace without
the JsonApi prefix in release 3.0. Deprecation warnings added now.
Checklist
CHANGELOG.md
AUTHORS