
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "posts",
    "title": "posts",
    "description": "Base posts definitions",
    "definitions": {
        "post": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "title": {
                    "type": "string",
                    "maxLength": 2000
                },
                "slug": {
                    "type": "string",
                    "maxLength": 191
                },
                "mobiledoc": {
                    "type": ["string", "null"],
                    "format": "json-string",
                    "maxLength": 1000000000
                },
                "html": {
                    "type": ["string", "null"],
                    "maxLength": 1000000000
                },
                "feature_image": {
                    "type": ["string", "null"],
                    "format": "uri-reference",
                    "maxLength": 2000
                },
                "featured": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string",
                    "enum": ["published", "draft", "scheduled"]
                },
                "locale": {
                    "type": ["string", "null"],
                    "maxLength": 6
                },
                "visibility": {
                    "type": ["string", "null"],
                    "enum": ["public", "members", "paid"]
                },
                "meta_title": {
                    "type": ["string", "null"],
                    "maxLength": 300
                },
                "meta_description": {
                    "type": ["string", "null"],
                    "maxLength": 500
                },
                "updated_at": {
                    "type": ["string", "null"],
                    "format": "date-time"
                },
                "published_at": {
                    "type": ["string", "null"],
                    "format": "date-time"
                },
                "custom_excerpt": {
                    "type": ["string", "null"],
                    "maxLength": 300
                },
                "codeinjection_head": {
                    "type": ["string", "null"],
                    "maxLength": 65535
                },
                "codeinjection_foot": {
                    "type": ["string", "null"],
                    "maxLength": 65535
                },
                "og_image": {
                    "type": ["string", "null"],
                    "format": "uri-reference",
                    "maxLength": 2000
                },
                "og_title": {
                    "type": ["string", "null"],
                    "maxLength": 300
                },
                "og_description": {
                    "type": ["string", "null"],
                    "maxLength": 500
                },
                "twitter_image": {
                    "type": ["string", "null"],
                    "format": "uri-reference",
                    "maxLength": 2000
                },
                "twitter_title": {
                    "type": ["string", "null"],
                    "maxLength": 300
                },
                "twitter_description": {
                    "type": ["string", "null"],
                    "maxLength": 500
                },
                "custom_template": {
                    "type": ["string", "null"],
                    "maxLength": 100
                },
                "canonical_url": {
                    "type": ["string", "null"],
                    "format": "uri-reference",
                    "maxLength": 2000
                },
                "authors": {
                    "$ref": "#/definitions/post-authors"
                },
                "tags": {
                    "$ref": "#/definitions/post-tags"
                },
                "id": {
                    "strip": true
                },
                "uuid": {
                    "strip": true
                },
                "comment_id": {
                    "strip": true
                },
                "author": {
                    "strip": true
                },
                "author_id": {
                    "strip": true
                },
                "page": {
                    "strip": true
                },
                "created_at": {
                    "strip": true
                },
                "created_by": {
                    "strip": true
                },
                "updated_by": {
                    "strip": true
                },
                "published_by": {
                    "strip": true
                },
                "url": {
                    "strip": true
                },
                "primary_tag": {
                    "strip": true
                },
                "primary_author": {
                    "strip": true
                },
                "excerpt": {
                    "strip": true
                },
                "plaintext": {
                    "strip": true
                }
            }
        },
        "post-authors": {
            "description": "Authors of the post",
            "type": "array",
            "items": {
                "anyOf": [{
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string",
                            "maxLength": 24
                        },
                        "slug": {
                            "type": "string",
                            "maxLength": 191
                        },
                        "email": {
                            "type": "string",
                            "maxLength": 191
                        },
                        "roles": {
                            "strip": true
                        },
                        "permissions": {
                            "strip": true
                        }
                    },
                    "anyOf": [
                        {"required": ["id"]},
                        {"required": ["slug"]},
                        {"required": ["email"]}
                    ]
                }, {
                    "type": "string",
                    "maxLength": 191
                }]
            }
        },
        "post-tags": {
            "description": "Tags of the post",
            "type": "array",
            "items": {
                "anyOf": [{
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string",
                            "maxLength": 24
                        },
                        "name": {
                            "type": "string",
                            "maxLength": 191
                        },
                        "slug": {
                            "type": ["string", "null"],
                            "maxLength": 191
                        },
                        "parent": {
                            "strip": true
                        },
                        "parent_id": {
                            "strip": true
                        },
                        "posts": {
                            "strip": true
                        }
                    },
                    "anyOf": [
                        {"required": ["id"]},
                        {"required": ["name"]},
                        {"required": ["slug"]}
                    ]
                }, {
                    "type": "string",
                    "maxLength": 191
                }]
            }
        }
    }
}
