{"action":"closed","issue":{"url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/471","repository_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api","labels_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/471/comments","events_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/471/events","html_url":"https://github.com/django-json-api/django-rest-framework-json-api/issues/471","id":356135789,"node_id":"MDU6SXNzdWUzNTYxMzU3ODk=","number":471,"title":"naming style: JSONAPI prefix or not?","user":{"login":"n2ygk","id":4356471,"node_id":"MDQ6VXNlcjQzNTY0NzE=","avatar_url":"https://avatars1.githubusercontent.com/u/4356471?v=4","gravatar_id":"","url":"https://api.github.com/users/n2ygk","html_url":"https://github.com/n2ygk","followers_url":"https://api.github.com/users/n2ygk/followers","following_url":"https://api.github.com/users/n2ygk/following{/other_user}","gists_url":"https://api.github.com/users/n2ygk/gists{/gist_id}","starred_url":"https://api.github.com/users/n2ygk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n2ygk/subscriptions","organizations_url":"https://api.github.com/users/n2ygk/orgs","repos_url":"https://api.github.com/users/n2ygk/repos","events_url":"https://api.github.com/users/n2ygk/events{/privacy}","received_events_url":"https://api.github.com/users/n2ygk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-31T22:03:35Z","updated_at":"2018-09-14T06:17:48Z","closed_at":"2018-09-14T06:17:48Z","author_association":"CONTRIBUTOR","body":"[This started as a misplaced comment thread in #467. Let's move it here.]\r\n\r\nI have a naming question: Do we prefix everything with `JSONAPI` or override existing names in DRF? We now have both styles:\r\n- DJA serializers override DRF's `HyperlinkedModelSerializer` and so on. The advantage is code written for DRF can upgrade to DJA by simply changing an import. The disadvantage is that it's easy to \"forget\" to change the import from `rest_framework` to `rest_framework_json_api`.\r\n- DJA paginators are named `JSONAPIPageNumberPagination` instead of overriding DRF's `PageNumberPagination`. The advantage is that it's very obvious that this is DJA-specific. The disadvantage is that instead of changing one import, you have to change each class use instance.\r\n\r\nThe approach here could be either:\r\n- [x] DJA `DefaultRouter` overriding DRF `DefaultRouter`. \r\n- [ ] DJA `JSONAPIDefaultRouter`\r\n\r\n---\r\n\r\n@sliverc replied:\r\n> Yeah I know I have also noticed. As we had to make backwards incompatible changes for pagination we started to add the JSONAPI prefix to work around this. There were also other cases in the past where this was done.\r\n\r\n> Actually I would prefer not to use `JSONAPI` prefix as it is already clear by the rest_framework_json_api module that it is imported from DJA. As you outlined this way someone can also easily switch between DRF and DJA version by simply changing the import.\r\n\r\n> However this won't be easy to accomplish to go that direction to make it consistent and backwards compatible. Potentially we have to break this at some point.\r\n\r\n> But for new things (actually haven't thought about that when reviewing the filter backends) we can easily leave out the `JSONAPI` prefix.\r\n\r\n> What is your preference?\r\n\r\n---\r\n\r\nI replied:\r\n\r\n>> As we had to make backwards incompatible changes for pagination\r\n\r\n> I don't think there was actually a backwards compatibility issue here as if one wants to be backward compatible they would just use `rest_framework.pagination.PageNumberPagination`. (Likewise for LimitOffset.)\r\n\r\n>> Potentially we have to break this at some point.\r\n\r\n> I say sooner than later. In the last release (2.5.0), we used the prefix `JsonApi` for paginators which is already deprecated by #463. The backend filters are not yet in a released version so have never been \"seen\" by their JSONAPI-prefixed names.\r\n\r\n> The only other instance I was able to find was `rest_framework_json_api.metadata.JSONAPIMetadata` which extends `rest_framework.metadata.SimpleMetadata`; This could easily be renamed (with deprecation) to `rest_framework_json_api.metadata.SimpleMetadata` which would more clearly show the inheritance as well.\r\n\r\n> The only other prefix I saw like this is `JSONAPIMeta` serializer inner class which I think is required to stay that way to distinguish it from the `Meta` inner class. \r\n\r\n>> What is your preference?\r\n\r\n> My preference is to put in the effort now:\r\n> - [x] drop the JSONAPI prefix from #466 before merging it. We have an open question (https://github.com/django-json-api/django-rest-framework-json-api/pull/466#discussion_r213601201) around naming it as well.\r\n> - [ ] new PR to back out the prefix changes done in #463 and eliminate the JsonApi prefix and add deprecation warnings for `page` vs. `page[number]` and `page_size` vs. `page[size]`. Or just document this as a breaking change: `page` and `page_size` were never correct JSON:API usage.\r\n> - [ ] new PR to rename/deprecate `JSONAPIMetadata`.\r\n\r\n> Do you agree?\r\n\r\n---\r\n\r\n@sliverc wrote:\r\n\r\n> There is also `JSONAPISettings` which we could rename to `APISettings`.\r\n\r\n> Also I have noticed that we are kind of getting into the habit to misuse some issues to discuss things which might be related but not actually the same issue.\r\n\r\n> I think for outsiders to better follow and to better track issues (e.g. a PR should solve one issue and not a comment of an issue) it would be better to create new issues for this (in this case a new issue where discussion happens on JSONAPI prefix).\r\n\r\n> I will also follow up on a issue for versioning and deprecation policy."}}
{"actor":{"display_login":"sliverc"}}