Skip to content

Instantly share code, notes, and snippets.

@Muzietto
Last active June 30, 2017 10:10
Show Gist options
  • Save Muzietto/6e3c75bbeb3cfdbd681ae8549b4f7071 to your computer and use it in GitHub Desktop.
Save Muzietto/6e3c75bbeb3cfdbd681ae8549b4f7071 to your computer and use it in GitHub Desktop.
Generic item for headless CMS
{
"id": "http://socialsweethearts.de/CmsEntry#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "schema for an headless_cms_mvp entry",
"type": "object",
"properties": {
"value": {
"type": "object",
"oneOf": [{
"$ref": "#/definitions/ListicleItems",
"$ref": "#/definitions/Quiz",
"$ref": "#/definitions/AdventCalendarItem"
}
]
},
"source": {
"enum": [
"youtube_video",
"twitter_post",
"facebook_post"
]
},
"title": {
"type": "string",
"maxLength": 255
},
"slug": {
"type": "string"
},
"description": {
"type": "string"
},
"addition": {
"type": "string"
},
"required": [
"title",
"slug",
"description",
"value"
]
},
"additionalProperties": false,
"definitions": {
"ListicleItems": {
"type": "array",
"items": {
"$ref": "#/definitions/ListicleItem"
},
"minItems": 3
},
"ListicleItem": {
"type": "object",
"required": [
"title"
],
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"maxLength": 255
},
"subtitle": {
"type": "string",
"maxLength": 255
},
"images": {
"type": "array",
"items": {
"$ref": "#/definitions/ImageItem"
},
"minItems": 1
},
"paragraphs": {
"type": "array",
"items": [{
"type": "string"
}]
},
"embeds": {
"type": "array",
"items": {
"$ref": "http://socialsweethearts.de/EmbedItem#"
}
}
}
},
"ImageItem": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"url": {
"type": "string"
},
"license": {
"type": "string"
}
},
"required": [
"url"
],
"additionalProperties": false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment