From a0a83b1e03c63cd9644798178829106dbf20bd3b Mon Sep 17 00:00:00 2001 From: Andy Gallagher Date: Mon, 19 Feb 2024 21:49:42 +0000 Subject: [PATCH 1/4] testing updates for bringing schema.org metadata into Concierge output --- models/src/main/thrift/content/schemaorg.thrift | 11 +++++++++++ models/src/main/thrift/content/v1.thrift | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 models/src/main/thrift/content/schemaorg.thrift diff --git a/models/src/main/thrift/content/schemaorg.thrift b/models/src/main/thrift/content/schemaorg.thrift new file mode 100644 index 0000000..1a6ffb4 --- /dev/null +++ b/models/src/main/thrift/content/schemaorg.thrift @@ -0,0 +1,11 @@ +namespace scala com.gu.contentapi.client.model.schemaorg +#@namespace typescript _at_guardian.content_api_models.schemaorg + + +struct SchemaRecipe { + 1: required string _at_context + 2: required string _at_type + 3: optional string name + 4: optional string description + 5: optional string image +} \ No newline at end of file diff --git a/models/src/main/thrift/content/v1.thrift b/models/src/main/thrift/content/v1.thrift index f48f8aa..935b01e 100644 --- a/models/src/main/thrift/content/v1.thrift +++ b/models/src/main/thrift/content/v1.thrift @@ -1,6 +1,7 @@ include "story_package_article.thrift" include "contentatom.thrift" include "entity.thrift" +include "schemaorg.thrift" namespace scala com.gu.contentapi.client.model.v1 #@namespace typescript _at_guardian.content_api_models.v1 @@ -1683,6 +1684,10 @@ struct ContentChannel { } +struct SchemaOrg { + 1: optional list recipe +} + struct Content { /* @@ -1824,6 +1829,10 @@ struct Content { */ 28: optional list channels + /* + * Schema.org compatible data + */ + 29: optional SchemaOrg schemaOrg } struct NetworkFront { From a555b63a7569f6865a620675cfdb1b1bb400c798 Mon Sep 17 00:00:00 2001 From: frederickobrien Date: Thu, 22 Feb 2024 12:51:28 +0000 Subject: [PATCH 2/4] Recipe schema thrift fields Companion to https://github.com/guardian/content-api/pull/2858 --- .../src/main/thrift/content/schemaorg.thrift | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/models/src/main/thrift/content/schemaorg.thrift b/models/src/main/thrift/content/schemaorg.thrift index 1a6ffb4..d63a8db 100644 --- a/models/src/main/thrift/content/schemaorg.thrift +++ b/models/src/main/thrift/content/schemaorg.thrift @@ -8,4 +8,29 @@ struct SchemaRecipe { 3: optional string name 4: optional string description 5: optional string image -} \ No newline at end of file + 6: optional string datePublished + 7: optional string url + 8: optional list recipeCategory + 9: optional list recipeCuisine + 10: optional list recipeIngredient + 11: optional list recipeInstructions + 12: optional list recipeYield + 13: optional string prepTime + 14: optional string cookTime + 15: optional string totalTime + 16: optional AuthorInfo author +} + +struct RecipeStep { + 1: required string _at_type + 2: required string text + 3: optional string name + 4: optional string url + 5: optional list image +} + +struct AuthorInfo { + 1: required string _at_type + 2: required string name + 3: optional list sameAs +} From fe556182596069132cf7fb8e0acd29acca8f5a12 Mon Sep 17 00:00:00 2001 From: frederickobrien Date: Fri, 8 Mar 2024 17:15:16 +0000 Subject: [PATCH 3/4] Optional 'suitableForDiet' and 'cookingMethod' fields --- models/src/main/thrift/content/schemaorg.thrift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/src/main/thrift/content/schemaorg.thrift b/models/src/main/thrift/content/schemaorg.thrift index d63a8db..b0f5cb0 100644 --- a/models/src/main/thrift/content/schemaorg.thrift +++ b/models/src/main/thrift/content/schemaorg.thrift @@ -19,6 +19,8 @@ struct SchemaRecipe { 14: optional string cookTime 15: optional string totalTime 16: optional AuthorInfo author + 17: optional string suitableForDiet + 18: optional string cookingMethod } struct RecipeStep { From 45423ba8ff1935aff22fd207ce460b422033aed1 Mon Sep 17 00:00:00 2001 From: frederickobrien Date: Tue, 12 Mar 2024 14:06:56 +0000 Subject: [PATCH 4/4] Review tweaks --- .../content/{schemaorg.thrift => schema_org.thrift} | 3 +++ models/src/main/thrift/content/v1.thrift | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) rename models/src/main/thrift/content/{schemaorg.thrift => schema_org.thrift} (94%) diff --git a/models/src/main/thrift/content/schemaorg.thrift b/models/src/main/thrift/content/schema_org.thrift similarity index 94% rename from models/src/main/thrift/content/schemaorg.thrift rename to models/src/main/thrift/content/schema_org.thrift index b0f5cb0..49a3bef 100644 --- a/models/src/main/thrift/content/schemaorg.thrift +++ b/models/src/main/thrift/content/schema_org.thrift @@ -1,6 +1,9 @@ namespace scala com.gu.contentapi.client.model.schemaorg #@namespace typescript _at_guardian.content_api_models.schemaorg +struct SchemaOrg { + 1: optional list recipe +} struct SchemaRecipe { 1: required string _at_context diff --git a/models/src/main/thrift/content/v1.thrift b/models/src/main/thrift/content/v1.thrift index 935b01e..a835608 100644 --- a/models/src/main/thrift/content/v1.thrift +++ b/models/src/main/thrift/content/v1.thrift @@ -1,7 +1,7 @@ include "story_package_article.thrift" include "contentatom.thrift" include "entity.thrift" -include "schemaorg.thrift" +include "schema_org.thrift" namespace scala com.gu.contentapi.client.model.v1 #@namespace typescript _at_guardian.content_api_models.v1 @@ -1684,10 +1684,6 @@ struct ContentChannel { } -struct SchemaOrg { - 1: optional list recipe -} - struct Content { /* @@ -1832,7 +1828,7 @@ struct Content { /* * Schema.org compatible data */ - 29: optional SchemaOrg schemaOrg + 29: optional schema_org.SchemaOrg schemaOrg } struct NetworkFront {