{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "version": "1.1.0",
    "type": "object",
    "properties": {
        "book": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "string"
                    },
                    "source": {
                        "type": "string"
                    },
                    "author": {
                        "type": "string"
                    },
                    "published": {
                        "type": "string"
                    },
                    "coverUrl": {
                        "type": "string"
                    },
                    "contents": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "headers": {
                                    "type": "array",
                                    "items": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "depth": {
                                                        "type": "integer"
                                                    },
                                                    "header": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "depth",
                                                    "header"
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "ordinal": {
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "enum": [
                                                "chapter",
                                                "appendix",
                                                "part",
                                                "episode",
                                                "level"
                                            ]
                                        },
                                        "identifier": {
                                            "type": [
                                                "integer",
                                                "string"
                                            ]
                                        }
                                    },
                                    "additionalProperties": false,
                                    "required": [
                                        "type",
                                        "identifier"
                                    ]
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "name"
                            ]
                        }
                    }
                },
                "additionalProperties": false,
                "required": [
                    "name",
                    "id",
                    "source",
                    "contents",
                    "published"
                ]
            }
        }
    },
    "additionalProperties": false
}