Skip to content

Commit 5d25e2f

Browse files
authored
Unified usage of JSON:API abbreviation (#945)
1 parent d20247f commit 5d25e2f

23 files changed

+75
-71
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Kevin Partington <[email protected]>
2121
Kieran Evans <[email protected]>
2222
2323
24+
Mansi Dhruv <[email protected]>
2425
Matt Layman <https://www.mattlayman.com>
2526
Michael Haselton <[email protected]>
2627
Mohammed Ali Zubair <[email protected]>

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ any parts of the framework not mentioned in the documentation should generally b
1010

1111
## [Unreleased]
1212

13+
### Fixed
14+
15+
* Adjusted error messages to correctly use capitial "JSON:API" abbreviation as used in the specification.
16+
1317
### Changed
1418

1519
* Moved resolving of `included_serialzers` and `related_serializers` classes to serializer's meta class.
@@ -104,10 +108,10 @@ This is the last release supporting Django 1.11, Django 2.1, Django REST Framewo
104108
### Added
105109

106110
* Added support for serializing nested serializers as attribute json value introducing setting `JSON_API_SERIALIZE_NESTED_SERIALIZERS_AS_ATTRIBUTE`
107-
* Note: As keys of nested serializers are not json:api spec field names they are not inflected by format field names option.
108-
* Added `rest_framework_json_api.serializer.Serializer` class to support initial JSON API views without models.
111+
* Note: As keys of nested serializers are not JSON:API spec field names they are not inflected by format field names option.
112+
* Added `rest_framework_json_api.serializer.Serializer` class to support initial JSON:API views without models.
109113
* Note that serializers derived from this class need to define `resource_name` in their `Meta` class.
110-
* This fix might be a **BREAKING CHANGE** if you use `rest_framework_json_api.serializers.Serializer` for non json:api spec views (usually `APIView`). You need to change those serializers classes to use `rest_framework.serializers.Serializer` instead.
114+
* This fix might be a **BREAKING CHANGE** if you use `rest_framework_json_api.serializers.Serializer` for non JSON:API spec views (usually `APIView`). You need to change those serializers classes to use `rest_framework.serializers.Serializer` instead.
111115

112116
### Fixed
113117

@@ -202,7 +206,7 @@ This is the last release supporting Python 2.7, Python 3.4, Django Filter 1.1, D
202206
* Don't swallow `filter[]` params when there are several
203207
* Fix DeprecationWarning regarding collections.abc import in Python 3.7
204208
* Allow OPTIONS request to be used on RelationshipView
205-
* Remove non-JSONAPI methods (PUT and TRACE) from ModelViewSet and RelationshipView.
209+
* Remove non-JSON:API methods (PUT and TRACE) from ModelViewSet and RelationshipView.
206210
This fix might be a **BREAKING CHANGE** if your clients are incorrectly using PUT instead of PATCH.
207211
* Avoid validation error for missing fields on a PATCH request using polymorphic serializers
208212

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
==================================
2-
JSON API and Django Rest Framework
2+
JSON:API and Django Rest Framework
33
==================================
44

55
.. image:: https://github.com/django-json-api/django-rest-framework-json-api/workflows/Tests/badge.svg
@@ -18,7 +18,7 @@ JSON API and Django Rest Framework
1818
Overview
1919
--------
2020

21-
**JSON API support for Django REST Framework**
21+
**JSON:API support for Django REST Framework**
2222

2323
* Documentation: https://django-rest-framework-json-api.readthedocs.org/
2424
* Format specification: http://jsonapi.org/format/
@@ -38,7 +38,7 @@ By default, Django REST Framework will produce a response like::
3838
}
3939

4040

41-
However, for an ``identity`` model in JSON API format the response should look
41+
However, for an ``identity`` model in JSON:API format the response should look
4242
like the following::
4343

4444
{
@@ -67,9 +67,9 @@ like the following::
6767
Goals
6868
-----
6969

70-
As a Django REST Framework JSON API (short DJA) we are trying to address following goals:
70+
As a Django REST Framework JSON:API (short DJA) we are trying to address following goals:
7171

72-
1. Support the `JSON API`_ spec to compliance
72+
1. Support the `JSON:API`_ spec to compliance
7373

7474
2. Be as compatible with `Django REST Framework`_ as possible
7575

@@ -81,7 +81,7 @@ As a Django REST Framework JSON API (short DJA) we are trying to address followi
8181

8282
5. Be performant
8383

84-
.. _JSON API: http://jsonapi.org
84+
.. _JSON:API: http://jsonapi.org
8585
.. _Django REST Framework: https://www.django-rest-framework.org/
8686

8787
------------
@@ -149,7 +149,7 @@ installed and activated:
149149

150150
Browse to
151151

152-
* http://localhost:8000 for the list of available collections (in a non-JSONAPI format!),
152+
* http://localhost:8000 for the list of available collections (in a non-JSON:API format!),
153153
* http://localhost:8000/swagger-ui/ for a Swagger user interface to the dynamic schema view, or
154154
* http://localhost:8000/openapi for the schema view's OpenAPI specification document.
155155

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Reporting a Vulnerability
44

5-
If you believe you've found something in Django REST Framework JSON API which has security implications, please **do not raise the issue in a public forum**.
5+
If you believe you've found something in Django REST Framework JSON:API which has security implications, please **do not raise the issue in a public forum**.
66

77
Send a description of the issue via email to [[email protected]][security-mail]. The project maintainers will then work with you to resolve any issues where required, prior to any public disclosure.
88

docs/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Django REST Framework JSON API (aka DJA) should be easy to contribute to.
3+
Django REST Framework JSON:API (aka DJA) should be easy to contribute to.
44
If anything is unclear about how to contribute,
55
please submit an issue on GitHub so that we can fix it!
66

@@ -11,7 +11,7 @@ if the proposed change makes sense for the project.
1111

1212
### Clone
1313

14-
To start developing on Django REST Framework JSON API you need to first clone the repository:
14+
To start developing on Django REST Framework JSON:API you need to first clone the repository:
1515

1616
git clone https://github.com/django-json-api/django-rest-framework-json-api.git
1717

docs/conf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
#
4-
# Django REST Framework JSON API documentation build configuration file, created by
4+
# Django REST Framework JSON:API documentation build configuration file, created by
55
# sphinx-quickstart on Fri Jul 24 23:31:15 2015.
66
#
77
# This file is execfile()d with the current directory set to its
@@ -59,10 +59,10 @@
5959
master_doc = "index"
6060

6161
# General information about the project.
62-
project = "Django REST Framework JSON API"
62+
project = "Django REST Framework JSON:API"
6363
year = datetime.date.today().year
64-
copyright = "{}, Django REST Framework JSON API contributors".format(year)
65-
author = "Django REST Framework JSON API contributors"
64+
copyright = "{}, Django REST Framework JSON:API contributors".format(year)
65+
author = "Django REST Framework JSON:API contributors"
6666

6767
# The version info for the project you're documenting, acts as replacement for
6868
# |version| and |release|, also used in various other places throughout the
@@ -244,8 +244,8 @@
244244
(
245245
master_doc,
246246
"DjangoRESTFrameworkJSONAPI.tex",
247-
"Django REST Framework JSON API Documentation",
248-
"Django REST Framework JSON API contributors",
247+
"Django REST Framework JSON:API Documentation",
248+
"Django REST Framework JSON:API contributors",
249249
"manual",
250250
),
251251
]
@@ -279,7 +279,7 @@
279279
(
280280
master_doc,
281281
"djangorestframeworkjsonapi",
282-
"Django REST Framework JSON API Documentation",
282+
"Django REST Framework JSON:API Documentation",
283283
[author],
284284
1,
285285
)
@@ -298,7 +298,7 @@
298298
(
299299
master_doc,
300300
"DjangoRESTFrameworkJSONAPI",
301-
"Django REST Framework JSON API Documentation",
301+
"Django REST Framework JSON:API Documentation",
302302
author,
303303
"DjangoRESTFrameworkJSONAPI",
304304
"One line description of project.",

docs/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Getting Started
33

4-
*Note: this package is named Django REST Framework JSON API to follow the naming
4+
*Note: this package is named Django REST Framework JSON:API to follow the naming
55
convention of other Django REST Framework packages. Since that's quite a bit
66
to say or type this package will be referred to as DJA elsewhere in these docs.*
77

@@ -20,7 +20,7 @@ By default, Django REST Framework produces a response like:
2020
```
2121

2222

23-
However, for the same `identity` model in JSON API format the response should look
23+
However, for the same `identity` model in JSON:API format the response should look
2424
like the following:
2525
``` js
2626
{
@@ -97,7 +97,7 @@ and add `rest_framework_json_api` to your `INSTALLED_APPS` setting below `rest_f
9797

9898

9999
Browse to
100-
* [http://localhost:8000](http://localhost:8000) for the list of available collections (in a non-JSONAPI format!),
100+
* [http://localhost:8000](http://localhost:8000) for the list of available collections (in a non-JSON:API format!),
101101
* [http://localhost:8000/swagger-ui/](http://localhost:8000/swagger-ui/) for a Swagger user interface to the dynamic schema view, or
102102
* [http://localhost:8000/openapi](http://localhost:8000/openapi) for the schema view's OpenAPI specification document.
103103

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.. Django REST Framework JSON API documentation master file, created by
1+
.. Django REST Framework JSON:API documentation master file, created by
22
sphinx-quickstart on Fri Jul 24 23:31:15 2015.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to Django REST Framework JSON API
6+
Welcome to Django REST Framework JSON:API
77
==========================================================
88

99
Contents:

docs/usage.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ class MyViewset(ModelViewSet):
240240
### Exception handling
241241

242242
For the `exception_handler` class, if the optional `JSON_API_UNIFORM_EXCEPTIONS` is set to True,
243-
all exceptions will respond with the JSON API [error format](http://jsonapi.org/format/#error-objects).
243+
all exceptions will respond with the JSON:API [error format](http://jsonapi.org/format/#error-objects).
244244

245-
When `JSON_API_UNIFORM_EXCEPTIONS` is False (the default), non-JSON API views will respond
245+
When `JSON_API_UNIFORM_EXCEPTIONS` is False (the default), non-JSON:API views will respond
246246
with the normal DRF error format.
247247

248248
### Performance Testing
@@ -312,8 +312,7 @@ multiple endpoints. Setting the `resource_name` on views may result in a differe
312312

313313
### Inflecting object and relation keys
314314

315-
This package includes the ability (off by default) to automatically convert [json
316-
api field names](http://jsonapi.org/format/#document-resource-object-fields) of requests and responses from the python/rest_framework's preferred underscore to
315+
This package includes the ability (off by default) to automatically convert [JSON:API field names](http://jsonapi.org/format/#document-resource-object-fields) of requests and responses from the python/rest_framework's preferred underscore to
317316
a format of your choice. To hook this up include the following setting in your
318317
project settings:
319318

@@ -524,8 +523,7 @@ The relationship name is formatted by the `JSON_API_FORMAT_FIELD_NAMES` setting,
524523

525524
#### ResourceRelatedField
526525

527-
Because of the additional structure needed to represent relationships in JSON
528-
API, this package provides the `ResourceRelatedField` for serializers, which
526+
Because of the additional structure needed to represent relationships in JSON:API, this package provides the `ResourceRelatedField` for serializers, which
529527
works similarly to `PrimaryKeyRelatedField`. By default,
530528
`rest_framework_json_api.serializers.ModelSerializer` will use this for
531529
related fields automatically. It can be instantiated explicitly as in the
@@ -896,7 +894,7 @@ Related links will be created automatically when using the Relationship View.
896894

897895
### Included
898896

899-
JSON API can include additional resources in a single network request.
897+
JSON:API can include additional resources in a single network request.
900898
The specification refers to this feature as
901899
[Compound Documents](http://jsonapi.org/format/#document-compound-documents).
902900
Compound Documents can reduce the number of network requests

example/tests/test_filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_sort_underscore(self):
104104

105105
def test_sort_related(self):
106106
"""
107-
test sort via related field using jsonapi path `.` and django orm `__` notation.
107+
test sort via related field using JSON:API path `.` and django orm `__` notation.
108108
ORM relations must be predefined in the View's .ordering_fields attr
109109
"""
110110
for datum in ("blog__id", "blog.id"):

0 commit comments

Comments
 (0)