{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://baodan.example/schemas/document-ir-v1.json", "title": "Insurance Document IR v1", "type": "object", "additionalProperties": false, "required": ["schemaVersion", "document", "pages", "tables", "quality"], "properties": { "schemaVersion": {"const": "document-ir-v1"}, "document": { "type": "object", "additionalProperties": false, "required": ["sha256", "mimeType", "pageCount", "pdfKind", "status"], "properties": { "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, "mimeType": {"const": "application/pdf"}, "pageCount": {"type": "integer", "minimum": 1}, "pdfKind": {"enum": ["native", "scanned", "mixed"]}, "status": {"enum": ["queued", "processing", "partial", "parsed", "blocked", "failed"]}, "parserVersion": {"type": "string"}, "ocrVersion": {"type": ["string", "null"]}, "profileCode": {"type": ["string", "null"]}, "profileVersion": {"type": ["string", "null"]} } }, "pages": { "type": "array", "items": {"$ref": "#/$defs/page"} }, "tables": { "type": "array", "items": {"$ref": "#/$defs/table"} }, "quality": { "type": "object", "required": ["nativePageCount", "ocrPageCount", "lowQualityPages"], "properties": { "nativePageCount": {"type": "integer", "minimum": 0}, "ocrPageCount": {"type": "integer", "minimum": 0}, "lowQualityPages": {"type": "array", "items": {"type": "integer", "minimum": 1}}, "warnings": {"type": "array", "items": {"type": "string"}} } } }, "$defs": { "bbox": { "type": "array", "prefixItems": [{"type": "number"}, {"type": "number"}, {"type": "number"}, {"type": "number"}], "minItems": 4, "maxItems": 4 }, "block": { "type": "object", "additionalProperties": false, "required": ["id", "text", "bbox", "source"], "properties": { "id": {"type": "string"}, "text": {"type": "string"}, "bbox": {"$ref": "#/$defs/bbox"}, "source": {"enum": ["native", "ocr"]}, "confidence": {"type": ["number", "null"], "minimum": 0, "maximum": 1} } }, "page": { "type": "object", "additionalProperties": false, "required": ["pageNumber", "width", "height", "pageClass", "textBlocks", "ocrBlocks"], "properties": { "pageNumber": {"type": "integer", "minimum": 1}, "width": {"type": "number", "exclusiveMinimum": 0}, "height": {"type": "number", "exclusiveMinimum": 0}, "pageClass": {"type": "string"}, "nativeTextQuality": {"type": ["number", "null"], "minimum": 0, "maximum": 1}, "ocrQuality": {"type": ["number", "null"], "minimum": 0, "maximum": 1}, "textBlocks": {"type": "array", "items": {"$ref": "#/$defs/block"}}, "ocrBlocks": {"type": "array", "items": {"$ref": "#/$defs/block"}} } }, "table": { "type": "object", "additionalProperties": false, "required": ["tableId", "scenarioType", "headers", "rows", "sourcePages"], "properties": { "tableId": {"type": "string"}, "scenarioType": {"type": "string"}, "headers": {"type": "array", "items": {"type": "object"}}, "rows": {"type": "array", "items": {"type": "object"}}, "sourcePages": {"type": "array", "items": {"type": "integer", "minimum": 1}}, "continuationOf": {"type": ["string", "null"]}, "bbox": {"anyOf": [{"$ref": "#/$defs/bbox"}, {"type": "null"}]}, "conflicts": {"type": "array", "items": {"type": "object"}} } } } }