{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "encounterbuilder.json",
	"version": "1.1.0",
	"type": "object",
	"$defs": {
		"_shapeTemplateNumericalValueFloat": {
			"oneOf": [
				{
					"type": "number"
				},
				{
					"type": "object",
					"description": "A fraction, expressed as a numerator and a denominator.",
					"properties": {
						"num": {
							"type": "number",
							"minimum": 1
						},
						"denom": {
							"type": "number",
							"minimum": 1
						}
					},
					"required": [
						"num",
						"denom"
					],
					"additionalProperties": false,
					"markdownDescription": "A fraction, expressed as a numerator and a denominator."
				}
			]
		},
		"_shapeTemplateNumericalTermExactInteger": {
			"type": "object",
			"properties": {
				"exact": {
					"type": "integer"
				}
			},
			"required": [
				"exact"
			],
			"additionalProperties": false
		},
		"_shapeTemplateNumericalTermExactFloat": {
			"type": "object",
			"properties": {
				"exact": {
					"$ref": "#/$defs/_shapeTemplateNumericalValueFloat"
				}
			},
			"required": [
				"exact"
			],
			"additionalProperties": false
		},
		"_shapeTemplateNumericalTermMinMaxInteger": {
			"type": "object",
			"properties": {
				"min": {
					"type": "integer"
				},
				"max": {
					"type": "integer"
				}
			},
			"required": [
				"min",
				"max"
			],
			"additionalProperties": false
		},
		"_shapeTemplateNumericalTermMinMaxFloat": {
			"type": "object",
			"properties": {
				"min": {
					"$ref": "#/$defs/_shapeTemplateNumericalValueFloat"
				},
				"max": {
					"$ref": "#/$defs/_shapeTemplateNumericalValueFloat"
				}
			},
			"required": [
				"min",
				"max"
			],
			"additionalProperties": false
		},
		"_shapeTemplateFormulaTermMinMax": {
			"type": "object",
			"properties": {
				"formulaMin": {
					"type": "string"
				},
				"formulaMax": {
					"type": "string"
				}
			},
			"required": [
				"formulaMin",
				"formulaMax"
			],
			"additionalProperties": false
		},
		"_shapeTemplateGroup": {
			"type": "object",
			"properties": {
				"count": {
					"oneOf": [
						{
							"$ref": "#/$defs/_shapeTemplateNumericalTermExactInteger"
						},
						{
							"$ref": "#/$defs/_shapeTemplateNumericalTermMinMaxInteger"
						},
						{
							"$ref": "#/$defs/_shapeTemplateFormulaTermMinMax"
						}
					]
				},
				"ratio": {
					"oneOf": [
						{
							"$ref": "#/$defs/_shapeTemplateNumericalTermExactFloat"
						},
						{
							"$ref": "#/$defs/_shapeTemplateNumericalTermMinMaxFloat"
						}
					]
				}
			},
			"required": [
				"count"
			],
			"additionalProperties": false
		},
		"_shapeTemplateItem": {
			"type": "object",
			"properties": {
				"groups": {
					"type": "array",
					"items": {
						"$ref": "#/$defs/_shapeTemplateGroup"
					},
					"minItems": 1
				}
			},
			"required": [
				"groups"
			],
			"additionalProperties": false
		},
		"encounterShapeData": {
			"type": "object",
			"properties": {
				"name": {
					"type": "string"
				},
				"source": {
					"$ref": "util.json#/$defs/source"
				},
				"otherSources": {
					"$ref": "util.json#/$defs/otherSources"
				},
				"referenceSources": {
					"$ref": "util.json#/$defs/referenceSources"
				},
				"page": {
					"$ref": "util.json#/$defs/page"
				},
				"reprintedAs": {
					"$ref": "util.json#/$defs/reprintedAs"
				},
				"shapeTemplate": {
					"type": "array",
					"items": {
						"$ref": "#/$defs/_shapeTemplateItem"
					},
					"minItems": 1,
					"uniqueItems": true
				}
			},
			"additionalProperties": false
		},
		"encounterShape": {
			"anyOf": [
				{
					"type": "object",
					"properties": {
						"name": {
							"type": "string"
						},
						"source": {
							"$ref": "util.json#/$defs/source"
						},
						"otherSources": {
							"$ref": "util.json#/$defs/otherSources"
						},
						"referenceSources": {
							"$ref": "util.json#/$defs/referenceSources"
						},
						"page": {
							"$ref": "util.json#/$defs/page"
						},
						"reprintedAs": {
							"$ref": "util.json#/$defs/reprintedAs"
						},
						"shapeTemplate": {
							"type": "array",
							"items": {
								"$ref": "#/$defs/_shapeTemplateItem"
							},
							"minItems": 1,
							"uniqueItems": true
						}
					},
					"additionalProperties": false,
					"required": [
						"name",
						"source",
						"shapeTemplate"
					]
				},
				{
					"type": "object",
					"properties": {
						"name": {
							"type": "string"
						},
						"source": {
							"$ref": "util.json#/$defs/source"
						},
						"otherSources": {
							"$ref": "util.json#/$defs/otherSources"
						},
						"referenceSources": {
							"$ref": "util.json#/$defs/referenceSources"
						},
						"page": {
							"$ref": "util.json#/$defs/page"
						},
						"reprintedAs": {
							"$ref": "util.json#/$defs/reprintedAs"
						},
						"shapeTemplate": {
							"type": "array",
							"items": {
								"$ref": "#/$defs/_shapeTemplateItem"
							},
							"minItems": 1,
							"uniqueItems": true
						},
						"_copy": {
							"$ref": "util-copy.json#/$defs/copyBlock_copy_generic"
						}
					},
					"additionalProperties": false,
					"required": [
						"_copy"
					]
				}
			]
		}
	},
	"properties": {
		"_meta": {
			"$ref": "util.json#/$defs/metaBlock"
		},
		"encounterShape": {
			"type": "array",
			"items": {
				"$ref": "#/$defs/encounterShape"
			},
			"minItems": 1,
			"uniqueItems": true
		}
	},
	"required": [
		"encounterShape"
	],
	"additionalProperties": false
}