From 7e80aacdb786b6f1f8dee238f1b1682aa8d23ab0 Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Fri, 25 Dec 2015 23:22:40 +0100 Subject: [PATCH] Fix JSON mistakes in README.md --- README.md | 42 ++++++++++++++++++++---------------------- routes/post.py | 32 +++++++++++++++----------------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 190ed48..f5dce56 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ query parameters. "related": "/papers/1/relationships/cite" } }, - … + ... } } ] @@ -138,7 +138,7 @@ Accept: application/vnd.api+json "related": "/papers/1/relationships/cite" } }, - … + ... } } } @@ -163,7 +163,7 @@ Accept: application/vnd.api+json "type": "papers", "id": 2, }, - … + ... ] } ``` @@ -196,24 +196,22 @@ Accept: application/vnd.api+json ```json { "data": { - { - "type": "papers", - "id": 1, - "attributes": { - "doi": "10.1126/science.1252319", - "arxiv_id": "1401.2910" + "type": "papers", + "id": 1, + "attributes": { + "doi": "10.1126/science.1252319", + "arxiv_id": "1401.2910" + }, + "links": { + "self": "/papers/1" + }, + "relationships": { + "cite": { + "links": { + "related": "/papers/1/relationships/cite" + } }, - "links": { - "self": "/papers/1" - }, - "relationships": { - "cite": { - "links": { - "related": "/papers/1/relationships/cite" - } - }, - … - } + ... } } } @@ -230,7 +228,7 @@ Accept: application/vnd.api+json { "data": [ { "type": "cite", "id": "2" }, - … + ... ] } ``` @@ -258,7 +256,7 @@ Accept: application/vnd.api+json { "data": [ { "type": "cite", "id": "2" }, - … + ... ] } ``` diff --git a/routes/post.py b/routes/post.py index d9a8929..be4ad3e 100644 --- a/routes/post.py +++ b/routes/post.py @@ -33,24 +33,22 @@ def create_paper(db): { "data": { - { - "type": "papers", - "id": 1, - "attributes": { - "doi": "10.1126/science.1252319", - "arxiv_id": "1401.2910" + "type": "papers", + "id": 1, + "attributes": { + "doi": "10.1126/science.1252319", + "arxiv_id": "1401.2910" + }, + "links": { + "self": "/papers/1" + }, + "relationships": { + "cite": { + "links": { + "related": "/papers/1/relationships/cite" + } }, - "links": { - "self": "/papers/1" - }, - "relationships": { - "cite": { - "links": { - "related": "/papers/1/relationships/cite" - } - }, - … - } + … } } }