{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://edaa-org.github.io/pyEDAA.Reports/Schemas/CoveragePy-2.schema.json",
	"title": "coverage.py JSON report, format 2",
	"description": "The JSON report coverage.py 7.4.1 to 7.5 write with 'coverage json', format version 2. Reverse-engineered from coverage.py's 'coverage/jsonreport.py' (7.16) and its change log: format 2 added 'meta.format'; a file has no regions 'functions' and 'classes', a summary no separate percentages of statements and branches.",
	"type": "object",
	"required": ["meta", "files", "totals"],
	"properties": {
		"meta": {
			"description": "How and when the report was written.",
			"type": "object",
			"required": ["format", "version", "timestamp", "branch_coverage", "show_contexts"],
			"properties": {
				"format":          {"description": "Version of the report format.", "const": 2},
				"version":         {"description": "Version of coverage.py.", "type": "string"},
				"timestamp":       {"description": "Time the report was written, ISO 8601.", "type": "string"},
				"branch_coverage": {"description": "Whether branch coverage was measured.", "type": "boolean"},
				"show_contexts":   {"description": "Whether the lines' contexts are listed.", "type": "boolean"}
			}
		},
		"files": {
			"description": "The measured files, by path relative to the directory coverage.py ran in.",
			"type": "object",
			"additionalProperties": {"$ref": "#/$defs/File"}
		},
		"totals": {"$ref": "#/$defs/Summary"}
	},
	"$defs": {
		"LineNumbers": {
			"type": "array",
			"items": {"type": "integer", "minimum": 1}
		},
		"Arcs": {
			"description": "Branches as pairs of source and destination line; a negative destination exits a code object.",
			"type": "array",
			"items": {
				"type": "array",
				"prefixItems": [{"type": "integer"}, {"type": "integer"}],
				"minItems": 2,
				"maxItems": 2
			}
		},
		"Contexts": {
			"description": "The contexts which ran a line, by line number.",
			"type": "object",
			"additionalProperties": {"type": "array", "items": {"type": "string"}}
		},
		"Summary": {
			"description": "Counters and percentages, as coverage.py computed them.",
			"type": "object",
			"required": ["covered_lines", "num_statements", "percent_covered", "missing_lines", "excluded_lines"],
			"properties": {
				"covered_lines":           {"type": "integer", "minimum": 0},
				"num_statements":          {"type": "integer", "minimum": 0},
				"percent_covered":         {"type": "number",  "minimum": 0, "maximum": 100},
				"percent_covered_display": {"type": "string"},
				"missing_lines":           {"type": "integer", "minimum": 0},
				"excluded_lines":          {"type": "integer", "minimum": 0},
				"num_branches":            {"type": "integer", "minimum": 0},
				"num_partial_branches":    {"type": "integer", "minimum": 0},
				"covered_branches":        {"type": "integer", "minimum": 0},
				"missing_branches":        {"type": "integer", "minimum": 0}
			},
			"additionalProperties": false
		},
		"Lines": {
			"description": "The lines and branches of a file or a region.",
			"type": "object",
			"required": ["executed_lines", "summary", "missing_lines", "excluded_lines"],
			"properties": {
				"executed_lines":    {"$ref": "#/$defs/LineNumbers"},
				"summary":           {"$ref": "#/$defs/Summary"},
				"missing_lines":     {"$ref": "#/$defs/LineNumbers"},
				"excluded_lines":    {"$ref": "#/$defs/LineNumbers"},
				"executed_branches": {"$ref": "#/$defs/Arcs"},
				"missing_branches":  {"$ref": "#/$defs/Arcs"},
				"contexts":          {"$ref": "#/$defs/Contexts"}
			}
		},
		"File": {
			"description": "A measured file: its lines and branches.",
			"allOf": [{"$ref": "#/$defs/Lines"}],
			"properties": {
				"executed_lines":    true,
				"summary":           true,
				"missing_lines":     true,
				"excluded_lines":    true,
				"executed_branches": true,
				"missing_branches":  true,
				"contexts":          true
			},
			"additionalProperties": false
		}
	}
}
