Skip to content

Commit

Permalink
Merge pull request #237 from guardian/ag/schema-org-field
Browse files Browse the repository at this point in the history
Recipe schema org thrift
  • Loading branch information
frederickobrien committed Mar 12, 2024
2 parents 0a7fa14 + 45423ba commit 2656e85
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
41 changes: 41 additions & 0 deletions models/src/main/thrift/content/schema_org.thrift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace scala com.gu.contentapi.client.model.schemaorg
#@namespace typescript _at_guardian.content_api_models.schemaorg

struct SchemaOrg {
1: optional list<SchemaRecipe> recipe
}

struct SchemaRecipe {
1: required string _at_context
2: required string _at_type
3: optional string name
4: optional string description
5: optional string image
6: optional string datePublished
7: optional string url
8: optional list<string> recipeCategory
9: optional list<string> recipeCuisine
10: optional list<string> recipeIngredient
11: optional list<RecipeStep> recipeInstructions
12: optional list<string> recipeYield
13: optional string prepTime
14: optional string cookTime
15: optional string totalTime
16: optional AuthorInfo author
17: optional string suitableForDiet
18: optional string cookingMethod
}

struct RecipeStep {
1: required string _at_type
2: required string text
3: optional string name
4: optional string url
5: optional list<string> image
}

struct AuthorInfo {
1: required string _at_type
2: required string name
3: optional list<string> sameAs
}
5 changes: 5 additions & 0 deletions models/src/main/thrift/content/v1.thrift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include "story_package_article.thrift"
include "contentatom.thrift"
include "entity.thrift"
include "schema_org.thrift"

namespace scala com.gu.contentapi.client.model.v1
#@namespace typescript _at_guardian.content_api_models.v1
Expand Down Expand Up @@ -1824,6 +1825,10 @@ struct Content {
*/
28: optional list<ContentChannel> channels

/*
* Schema.org compatible data
*/
29: optional schema_org.SchemaOrg schemaOrg
}

struct NetworkFront {
Expand Down

0 comments on commit 2656e85

Please sign in to comment.