Skip to content

Commit 45d4224

Browse files
authored
Fixes #818 (#824)
Correctly document JSON API ids as string
1 parent 7458d56 commit 45d4224

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ like the following::
4848
},
4949
"data": [{
5050
"type": "identities",
51-
"id": 3,
51+
"id": "3",
5252
"attributes": {
5353
"username": "john",
5454
"full-name": "John Coltrane"

Diff for: docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ like the following:
3232
},
3333
"data": [{
3434
"type": "identities",
35-
"id": 3,
35+
"id": "3",
3636
"attributes": {
3737
"username": "john",
3838
"full-name": "John Coltrane"

Diff for: docs/usage.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Example - Without format conversion:
338338
{
339339
"data": [{
340340
"type": "identities",
341-
"id": 3,
341+
"id": "3",
342342
"attributes": {
343343
"username": "john",
344344
"first_name": "John",
@@ -359,7 +359,7 @@ Example - With format conversion set to `dasherize`:
359359
{
360360
"data": [{
361361
"type": "identities",
362-
"id": 3,
362+
"id": "3",
363363
"attributes": {
364364
"username": "john",
365365
"first-name": "John",
@@ -389,7 +389,7 @@ Example without format conversion:
389389
{
390390
"data": [{
391391
"type": "blog_identity",
392-
"id": 3,
392+
"id": "3",
393393
"attributes": {
394394
...
395395
},
@@ -412,7 +412,7 @@ When set to dasherize:
412412
{
413413
"data": [{
414414
"type": "blog-identity",
415-
"id": 3,
415+
"id": "3",
416416
"attributes": {
417417
...
418418
},
@@ -438,15 +438,15 @@ Example without pluralization:
438438
{
439439
"data": [{
440440
"type": "identity",
441-
"id": 3,
441+
"id": "3",
442442
"attributes": {
443443
...
444444
},
445445
"relationships": {
446446
"home_towns": {
447447
"data": [{
448448
"type": "home_town",
449-
"id": 3
449+
"id": "3"
450450
}]
451451
}
452452
}
@@ -461,15 +461,15 @@ When set to pluralize:
461461
{
462462
"data": [{
463463
"type": "identities",
464-
"id": 3,
464+
"id": "3",
465465
"attributes": {
466466
...
467467
},
468468
"relationships": {
469469
"home_towns": {
470470
"data": [{
471471
"type": "home_towns",
472-
"id": 3
472+
"id": "3"
473473
}]
474474
}
475475
}

Diff for: rest_framework_json_api/renderers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class JSONRenderer(renderers.JSONRenderer):
3333
"data": [
3434
{
3535
"type": "companies",
36-
"id": 1,
36+
"id": "1",
3737
"attributes": {
3838
"name": "Mozilla",
3939
"slug": "mozilla",

0 commit comments

Comments
 (0)