{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "corpus-shared.json",
	"version": "1.0.5",
	"$defs": {
		"wrappedAdventureBookDataArray": {
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"id": {
						"$ref": "util.json#/$defs/corpusId"
					},
					"source": {
						"$ref": "util.json#/$defs/source"
					},
					"data": {
						"$ref": "util.json#/$defs/adventureBookData"
					}
				},
				"required": [
					"id",
					"source",
					"data"
				],
				"additionalProperties": false
			},
			"minItems": 1,
			"uniqueItems": true
		},
		"corpusCover": {
			"description": "A link to an image. Preferred sizes are 300 x 300px or 600 x 600px.",
			"$ref": "entry.json#/$defs/mediaHref",
			"markdownDescription": "A link to an image. Preferred sizes are 300 x 300px or 600 x 600px."
		},
		"corpusCoverCredit": {
			"type": "string"
		},
		"corpusContents": {
			"description": "The linked Table of Contents of the corpus.",
			"type": "array",
			"minItems": 1,
			"items": {
				"type": "object",
				"properties": {
					"name": {
						"type": "string"
					},
					"headers": {
						"type": "array",
						"minItems": 1,
						"items": {
							"oneOf": [
								{
									"type": "string"
								},
								{
									"type": "object",
									"properties": {
										"header": {
											"type": "string"
										},
										"source": {
											"$ref": "util.json#/$defs/source"
										},
										"depth": {
											"type": "integer"
										},
										"statblock": {
											"const": true
										},
										"tag": {
											"type": "string"
										},
										"uid": {
											"type": "string"
										},
										"index": {
											"description": "The relative index of this header in the current chapter, i.e. if \"Treasure\" appears twice and you wish the contents entry to link to the second instance, set the \"index\" to 1.",
											"type": "integer",
											"markdownDescription": "The relative index of this header in the current chapter, i.e. if &quot;Treasure&quot; appears twice and you wish the contents entry to link to the second instance, set the &quot;index&quot; to 1."
										}
									},
									"required": [
										"header"
									],
									"dependentRequired": {
										"source": [
											"statblock"
										],
										"tag": [
											"statblock",
											"uid"
										],
										"uid": [
											"statblock",
											"tag"
										]
									},
									"additionalProperties": false
								}
							]
						}
					},
					"ordinal": {
						"type": "object",
						"properties": {
							"type": {
								"type": "string",
								"enum": [
									"chapter",
									"appendix",
									"part",
									"episode",
									"level",
									"section"
								]
							},
							"identifier": {
								"type": [
									"integer",
									"string"
								]
							}
						},
						"additionalProperties": false,
						"required": [
							"type"
						]
					}
				},
				"additionalProperties": false,
				"required": [
					"name"
				]
			},
			"markdownDescription": "The linked Table of Contents of the corpus."
		},
		"corpusPublished": {
			"type": "string",
			"format": "date",
			"description": "The date of publication of the book, in the format YYYY-MM-DD (RFC3339).",
			"markdownDescription": "The date of publication of the book, in the format YYYY-MM-DD (RFC3339)."
		},
		"corpusParentSource": {
			"type": "string",
			"description": "Used for sources which contain multiple adventures, e.g. TftYP, or \"packages\" of related books, e.g. SAiS.",
			"$ref": "util.json#/$defs/source",
			"markdownDescription": "Used for sources which contain multiple adventures, e.g. TftYP, or &quot;packages&quot; of related books, e.g. SAiS."
		}
	}
}