124 lines
4.2 KiB
JSON
124 lines
4.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://example.invalid/schemas/test-report.schema.json",
|
|
"title": "Normalized Test Automation Report",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["schema_version", "run", "project", "tool", "target", "summary", "results"],
|
|
"properties": {
|
|
"schema_version": { "const": "1.0.0" },
|
|
"run": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "started_at", "source"],
|
|
"properties": {
|
|
"id": { "type": "string", "minLength": 1 },
|
|
"started_at": { "type": "string", "format": "date-time" },
|
|
"source": { "type": "string", "enum": ["gitlab", "local"] },
|
|
"pipeline_url": { "type": "string" },
|
|
"commit_sha": { "type": "string" }
|
|
}
|
|
},
|
|
"project": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "name", "environment"],
|
|
"properties": {
|
|
"id": { "type": "string", "minLength": 1 },
|
|
"name": { "type": "string", "minLength": 1 },
|
|
"environment": { "type": "string", "minLength": 1 },
|
|
"customer": { "type": "string" },
|
|
"location": { "type": "string" }
|
|
}
|
|
},
|
|
"tool": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "name"],
|
|
"properties": {
|
|
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]*$" },
|
|
"name": { "type": "string", "minLength": 1 },
|
|
"version": { "type": "string" },
|
|
"adapter_version": { "type": "string" }
|
|
}
|
|
},
|
|
"target": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "type"],
|
|
"properties": {
|
|
"id": { "type": "string", "minLength": 1 },
|
|
"type": { "type": "string", "minLength": 1 },
|
|
"address": { "type": "string" },
|
|
"groups": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
|
|
}
|
|
},
|
|
"summary": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["total", "passed", "failed", "errors", "skipped", "review"],
|
|
"properties": {
|
|
"total": { "type": "integer", "minimum": 0 },
|
|
"passed": { "type": "integer", "minimum": 0 },
|
|
"failed": { "type": "integer", "minimum": 0 },
|
|
"errors": { "type": "integer", "minimum": 0 },
|
|
"skipped": { "type": "integer", "minimum": 0 },
|
|
"review": { "type": "integer", "minimum": 0 },
|
|
"score": { "type": "number", "minimum": 0, "maximum": 100 }
|
|
}
|
|
},
|
|
"results": {
|
|
"type": "array",
|
|
"items": { "$ref": "#/$defs/result" }
|
|
},
|
|
"raw_artifacts": {
|
|
"type": "array",
|
|
"items": { "type": "string" },
|
|
"uniqueItems": true
|
|
}
|
|
},
|
|
"$defs": {
|
|
"result": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "title", "status", "severity"],
|
|
"properties": {
|
|
"id": { "type": "string", "minLength": 1 },
|
|
"title": { "type": "string", "minLength": 1 },
|
|
"description": { "type": "string" },
|
|
"status": { "type": "string", "enum": ["passed", "failed", "error", "skipped", "review"] },
|
|
"severity": { "type": "string", "enum": ["info", "low", "medium", "high", "critical"] },
|
|
"category": { "type": "string" },
|
|
"expected": { "type": "string" },
|
|
"observed": { "type": "string" },
|
|
"remediation": { "type": "string" },
|
|
"standards": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["framework", "control"],
|
|
"properties": {
|
|
"framework": { "type": "string" },
|
|
"version": { "type": "string" },
|
|
"control": { "type": "string" }
|
|
}
|
|
}
|
|
},
|
|
"evidence": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["type", "value"],
|
|
"properties": {
|
|
"type": { "type": "string", "enum": ["text", "file", "url"] },
|
|
"name": { "type": "string" },
|
|
"value": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |