diff --git a/README.rst b/README.rst index b3162184..bc52bbf5 100644 --- a/README.rst +++ b/README.rst @@ -48,7 +48,7 @@ like the following:: }, "data": [{ "type": "identities", - "id": 3, + "id": "3", "attributes": { "username": "john", "full-name": "John Coltrane" diff --git a/docs/getting-started.md b/docs/getting-started.md index bef744eb..58768e39 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -32,7 +32,7 @@ like the following: }, "data": [{ "type": "identities", - "id": 3, + "id": "3", "attributes": { "username": "john", "full-name": "John Coltrane" diff --git a/docs/usage.md b/docs/usage.md index 5b7010d3..9fd46e6b 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -338,7 +338,7 @@ Example - Without format conversion: { "data": [{ "type": "identities", - "id": 3, + "id": "3", "attributes": { "username": "john", "first_name": "John", @@ -359,7 +359,7 @@ Example - With format conversion set to `dasherize`: { "data": [{ "type": "identities", - "id": 3, + "id": "3", "attributes": { "username": "john", "first-name": "John", @@ -389,7 +389,7 @@ Example without format conversion: { "data": [{ "type": "blog_identity", - "id": 3, + "id": "3", "attributes": { ... }, @@ -412,7 +412,7 @@ When set to dasherize: { "data": [{ "type": "blog-identity", - "id": 3, + "id": "3", "attributes": { ... }, @@ -438,7 +438,7 @@ Example without pluralization: { "data": [{ "type": "identity", - "id": 3, + "id": "3", "attributes": { ... }, @@ -446,7 +446,7 @@ Example without pluralization: "home_towns": { "data": [{ "type": "home_town", - "id": 3 + "id": "3" }] } } @@ -461,7 +461,7 @@ When set to pluralize: { "data": [{ "type": "identities", - "id": 3, + "id": "3", "attributes": { ... }, @@ -469,7 +469,7 @@ When set to pluralize: "home_towns": { "data": [{ "type": "home_towns", - "id": 3 + "id": "3" }] } } diff --git a/rest_framework_json_api/renderers.py b/rest_framework_json_api/renderers.py index ccd71510..cfc74f1f 100644 --- a/rest_framework_json_api/renderers.py +++ b/rest_framework_json_api/renderers.py @@ -33,7 +33,7 @@ class JSONRenderer(renderers.JSONRenderer): "data": [ { "type": "companies", - "id": 1, + "id": "1", "attributes": { "name": "Mozilla", "slug": "mozilla",