From cb24a612ead42c7144a3cf07392dbbb2a0e14714 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 13 Aug 2023 19:17:54 -0400 Subject: [PATCH] Commit erc.v1.json schema --- resources/schemas/erc.v1.json | 158 ++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 resources/schemas/erc.v1.json diff --git a/resources/schemas/erc.v1.json b/resources/schemas/erc.v1.json new file mode 100644 index 0000000000..2e07dd5c68 --- /dev/null +++ b/resources/schemas/erc.v1.json @@ -0,0 +1,158 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.kicad.org/erc.v1.json", + "title": "KiCad ERC Report Schema", + "description": "KiCad Electrical Rules Check (ERC) Results Report generated from schematics", + "type": "object", + "additionalProperties": false, + "properties": { + "source": { + "type": "string", + "description": "Source file path" + }, + "date": { + "type": "string", + "description": "Time at generation of report", + "format": "date-time" + }, + "kicad_version": { + "type": "string", + "description": "KiCad version used to generate the report", + "pattern": "^\\d{1,2}(\\.\\d{1,2}(\\.\\d{1,2})?)?$" + }, + "sheets": { + "type": "array", + "items": { + "$ref": "#/definitions/Sheet" + } + }, + "coordinate_units": { + "type": "string", + "description": "Units that all coordinates in this report are encoded in", + "enum": [ + "mm", + "mils", + "in" + ] + } + }, + "required": [ + "source", + "date", + "kicad_version", + "sheets" + ], + "definitions": { + "Sheet": { + "type": "object", + "additionalProperties": false, + "properties": { + "uuid_path": { + "$ref": "#/definitions/UuidPath" + }, + "path": { + "type": "string", + "description": "KiCad type name for the violation" + }, + "violations": { + "type": "array", + "items": { + "$ref": "#/definitions/Violation" + } + } + }, + "required": [ + "uuid_path", + "path", + "violations" + ] + }, + "Violation": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "description": "KiCad type name for the violation" + }, + "description": { + "type": "string", + "description": "Description of the violation" + }, + "severity": { + "$ref": "#/definitions/Severity" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/AffectedItem" + } + } + }, + "required": [ + "type", + "description", + "severity", + "items" + ] + }, + "AffectedItem": { + "type": "object", + "additionalProperties": false, + "properties": { + "uuid": { + "$ref": "#/definitions/Uuid" + }, + "description": { + "type": "string", + "description": "Description of the item" + }, + "pos": { + "$ref": "#/definitions/Coordinate" + } + }, + "required": [ + "uuid", + "description", + "pos" + ] + }, + "UuidPath": { + "type": "string", + "description": "Path based on chain of Uuids", + "pattern": "^(/[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12})+$" + }, + "Uuid": { + "type": "string", + "description": "Unique identifier of the item", + "pattern": "^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$" + }, + "Severity": { + "type": "string", + "description": "Severity of the violation", + "enum": [ + "error", + "warning", + "ignore" + ] + }, + "Coordinate": { + "type": "object", + "additionalProperties": false, + "properties": { + "x": { + "type": "number", + "description": "x coordinate" + }, + "y": { + "type": "number", + "description": "y coordinate" + } + }, + "required": [ + "x", + "y" + ] + } + } +} \ No newline at end of file