{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/NazarKalytiuk/tarn/main/schemas/v1/report.json", "title": "Tarn JSON Report v1", "type": "object", "required": ["schema_version", "version", "timestamp", "duration_ms", "files", "summary"], "properties": { "schema_version": { "const": 1 }, "version": { "const": "1" }, "timestamp": { "type": "string" }, "duration_ms": { "type": "integer", "minimum": 0 }, "files": { "type": "array", "items": { "$ref": "#/$defs/fileResult" } }, "summary": { "$ref": "#/$defs/runSummary" } }, "$defs": { "status": { "type": "string", "enum": ["PASSED", "FAILED"] }, "failureCategory": { "type": "string", "enum": [ "assertion_failed", "response_shape_mismatch", "connection_error", "timeout", "parse_error", "capture_error", "unresolved_template", "skipped_due_to_failed_capture", "skipped_due_to_fail_fast", "skipped_by_condition" ] }, "errorCode": { "type": "string", "enum": [ "assertion_mismatch", "capture_extraction_failed", "poll_condition_not_met", "request_timed_out", "connection_refused", "dns_resolution_failed", "tls_verification_failed", "redirect_limit_exceeded", "network_error", "interpolation_failed", "validation_failed", "configuration_error", "parse_error", "skipped_dependency" ] }, "requestInfo": { "type": "object", "required": ["method", "url", "headers", "body"], "properties": { "method": { "type": "string" }, "url": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "body": {} } }, "responseInfo": { "type": "object", "required": ["status", "headers", "body"], "properties": { "status": { "type": "integer", "minimum": 100, "maximum": 599 }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "body": {} } }, "location": { "type": "object", "description": "Source position of the originating YAML node. Emitted by Tarn for steps and for every assertion that maps back to a YAML operator key. Line and column are 1-based and `file` matches the path tarn prints in other report fields. Optional for backwards compatibility.", "required": ["file", "line", "column"], "properties": { "file": { "type": "string" }, "line": { "type": "integer", "minimum": 1 }, "column": { "type": "integer", "minimum": 1 } } }, "assertionDetail": { "type": "object", "required": ["assertion", "passed", "expected", "actual", "message"], "properties": { "assertion": { "type": "string" }, "passed": { "type": "boolean" }, "expected": { "type": "string" }, "actual": { "type": "string" }, "message": { "type": "string" }, "diff": { "type": ["string", "null"] }, "location": { "$ref": "#/$defs/location" } } }, "assertionFailure": { "type": "object", "required": ["assertion", "expected", "actual", "message"], "properties": { "assertion": { "type": "string" }, "expected": { "type": "string" }, "actual": { "type": "string" }, "message": { "type": "string" }, "diff": { "type": ["string", "null"] }, "location": { "$ref": "#/$defs/location" }, "hints": { "type": "array", "description": "Optional single-line diagnostic hints that surface a likely root cause (e.g. NestJS-style route-ordering collisions). Emitted only when Tarn is confident about the signal.", "items": { "type": "string" } } } }, "assertionSummary": { "type": "object", "required": ["total", "passed", "failed", "details"], "properties": { "total": { "type": "integer", "minimum": 0 }, "passed": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 }, "details": { "type": "array", "items": { "$ref": "#/$defs/assertionDetail" } }, "failures": { "type": "array", "items": { "$ref": "#/$defs/assertionFailure" } } } }, "stepResult": { "type": "object", "required": ["name", "status", "duration_ms", "assertions"], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "status": { "$ref": "#/$defs/status" }, "duration_ms": { "type": "integer", "minimum": 0 }, "assertions": { "$ref": "#/$defs/assertionSummary" }, "failure_category": { "$ref": "#/$defs/failureCategory" }, "error_code": { "$ref": "#/$defs/errorCode" }, "remediation_hints": { "type": "array", "items": { "type": "string" } }, "response_status": { "type": "integer", "minimum": 100, "maximum": 599 }, "response_summary": { "type": "string" }, "captures_set": { "type": "array", "items": { "type": "string" } }, "location": { "$ref": "#/$defs/location" }, "request": { "$ref": "#/$defs/requestInfo" }, "response": { "$ref": "#/$defs/responseInfo" } } }, "testResult": { "type": "object", "required": ["name", "description", "status", "duration_ms", "steps"], "properties": { "name": { "type": "string" }, "description": { "type": ["string", "null"] }, "status": { "$ref": "#/$defs/status" }, "duration_ms": { "type": "integer", "minimum": 0 }, "steps": { "type": "array", "items": { "$ref": "#/$defs/stepResult" } }, "captures": { "type": "object" } } }, "fileSummary": { "type": "object", "required": ["total", "passed", "failed"], "properties": { "total": { "type": "integer", "minimum": 0 }, "passed": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 } } }, "fileResult": { "type": "object", "required": ["file", "name", "status", "duration_ms", "summary", "setup", "tests", "teardown"], "properties": { "file": { "type": "string" }, "name": { "type": "string" }, "status": { "$ref": "#/$defs/status" }, "duration_ms": { "type": "integer", "minimum": 0 }, "summary": { "$ref": "#/$defs/fileSummary" }, "setup": { "type": "array", "items": { "$ref": "#/$defs/stepResult" } }, "tests": { "type": "array", "items": { "$ref": "#/$defs/testResult" } }, "teardown": { "type": "array", "items": { "$ref": "#/$defs/stepResult" } } } }, "runSummary": { "type": "object", "required": ["files", "tests", "steps", "status"], "properties": { "files": { "type": "integer", "minimum": 0 }, "tests": { "type": "integer", "minimum": 0 }, "status": { "$ref": "#/$defs/status" }, "steps": { "type": "object", "required": ["total", "passed", "failed"], "properties": { "total": { "type": "integer", "minimum": 0 }, "passed": { "type": "integer", "minimum": 0 }, "failed": { "type": "integer", "minimum": 0 } } } } } } }