From 8b680042e0bf21d71b78638e7d9bbf8712ed7cab Mon Sep 17 00:00:00 2001 From: Tyler Davis Date: Fri, 29 Jan 2021 13:03:35 -0500 Subject: [PATCH] Contributors Proposal Implementation (#234) --- .../resources/schema/ans/0.10.7/content.json | 4 ++++ .../resources/schema/ans/0.10.7/gallery.json | 4 ++++ .../resources/schema/ans/0.10.7/image.json | 3 +++ .../resources/schema/ans/0.10.7/story.json | 4 ++++ .../ans/0.10.7/traits/trait_contributors.json | 24 +++++++++++++++++++ .../resources/schema/ans/0.10.7/video.json | 3 +++ .../schema/0.10.6/story-fixture-good.json | 9 ++++--- .../schema/0.10.7/image-fixture-good.json | 6 +++++ .../schema/0.10.7/story-fixture-good.json | 15 +++++++++--- 9 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json diff --git a/src/main/resources/schema/ans/0.10.7/content.json b/src/main/resources/schema/ans/0.10.7/content.json index 177ed8ed..46eb0de4 100644 --- a/src/main/resources/schema/ans/0.10.7/content.json +++ b/src/main/resources/schema/ans/0.10.7/content.json @@ -136,6 +136,10 @@ "content_aliases": { "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_content_aliases.json" + }, + + "contributors": { + "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json" } }, diff --git a/src/main/resources/schema/ans/0.10.7/gallery.json b/src/main/resources/schema/ans/0.10.7/gallery.json index 79670580..51e18630 100644 --- a/src/main/resources/schema/ans/0.10.7/gallery.json +++ b/src/main/resources/schema/ans/0.10.7/gallery.json @@ -157,6 +157,10 @@ "websites": { "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_websites.json" + }, + + "contributors": { + "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json" } }, diff --git a/src/main/resources/schema/ans/0.10.7/image.json b/src/main/resources/schema/ans/0.10.7/image.json index a0607f1e..aff62ca9 100644 --- a/src/main/resources/schema/ans/0.10.7/image.json +++ b/src/main/resources/schema/ans/0.10.7/image.json @@ -169,6 +169,9 @@ "licensable": { "description": "True if the image can legally be licensed to others.", "type": "boolean" + }, + "contributors": { + "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json" } }, "required": [ "type", "version" ] diff --git a/src/main/resources/schema/ans/0.10.7/story.json b/src/main/resources/schema/ans/0.10.7/story.json index 91693a11..c22442fa 100644 --- a/src/main/resources/schema/ans/0.10.7/story.json +++ b/src/main/resources/schema/ans/0.10.7/story.json @@ -167,6 +167,10 @@ "websites": { "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_websites.json" + }, + + "contributors": { + "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json" } }, diff --git a/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json b/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json new file mode 100644 index 00000000..d9dd4395 --- /dev/null +++ b/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json", + "title": "Contributors", + "description": "Trait that holds information on who created and contributed to a given document in Arc.", + "type": "object", + "additionalProperties": false, + "properties": { + "created_by": { + "description": "The Creator of the Document.", + "type":"object", + "properties": { + "user_id": { + "type": "string", + "description": "The unique ID of the Arc user who created the Document" + }, + "display_name": { + "type": "string", + "description": "The display name of the Arc user who created the Document" + } + } + } + } +} diff --git a/src/main/resources/schema/ans/0.10.7/video.json b/src/main/resources/schema/ans/0.10.7/video.json index 7da0ec1a..956ebf8c 100644 --- a/src/main/resources/schema/ans/0.10.7/video.json +++ b/src/main/resources/schema/ans/0.10.7/video.json @@ -192,6 +192,9 @@ }, "websites": { "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_websites.json" + }, + "contributors": { + "$ref": "https://raw.githubusercontent.com/washingtonpost/ans-schema/master/src/main/resources/schema/ans/0.10.7/traits/trait_contributors.json" } }, diff --git a/tests/fixtures/schema/0.10.6/story-fixture-good.json b/tests/fixtures/schema/0.10.6/story-fixture-good.json index 2072e99f..53e10883 100644 --- a/tests/fixtures/schema/0.10.6/story-fixture-good.json +++ b/tests/fixtures/schema/0.10.6/story-fixture-good.json @@ -331,7 +331,8 @@ "content_elements": [ { "type": "image", - "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Underwoodfive.jpg/220px-Underwoodfive.jpg" + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Underwoodfive.jpg/220px-Underwoodfive.jpg", + "version": "0.10.6" }, { "type": "text", @@ -422,12 +423,14 @@ { "type": "image", "url": "http://foo.com/foo.jpg", - "caption": "Foo" + "caption": "Foo", + "version": "0.10.6" }, { "type": "image", "url": "http://bar.com/bar.jpg", - "caption": "Bar" + "caption": "Bar", + "version": "0.10.6" } ] }, diff --git a/tests/fixtures/schema/0.10.7/image-fixture-good.json b/tests/fixtures/schema/0.10.7/image-fixture-good.json index fd05507c..331bc442 100644 --- a/tests/fixtures/schema/0.10.7/image-fixture-good.json +++ b/tests/fixtures/schema/0.10.7/image-fixture-good.json @@ -14,6 +14,12 @@ } ] }, + "contributors": { + "created_by" : { + "user_id": "william.davis@washpost.com", + "display_name": "Tyler Davis" + } + }, "location": "Washington, D.C.", "geo": { "latitude": 38.9047, diff --git a/tests/fixtures/schema/0.10.7/story-fixture-good.json b/tests/fixtures/schema/0.10.7/story-fixture-good.json index d50c36a6..5b3677d3 100644 --- a/tests/fixtures/schema/0.10.7/story-fixture-good.json +++ b/tests/fixtures/schema/0.10.7/story-fixture-good.json @@ -35,6 +35,12 @@ } ] }, + "contributors": { + "created_by" : { + "user_id": "william.davis@washpost.com", + "display_name": "Tyler Davis" + } + }, "language": "en", "location": "Washington, D.C.", "geo": { @@ -331,7 +337,8 @@ "content_elements": [ { "type": "image", - "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Underwoodfive.jpg/220px-Underwoodfive.jpg" + "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Underwoodfive.jpg/220px-Underwoodfive.jpg", + "version": "0.10.7" }, { "type": "text", @@ -422,12 +429,14 @@ { "type": "image", "url": "http://foo.com/foo.jpg", - "caption": "Foo" + "caption": "Foo", + "version": "0.10.7" }, { "type": "image", "url": "http://bar.com/bar.jpg", - "caption": "Bar" + "caption": "Bar", + "version": "0.10.7" } ] },