{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "urn:wavenumber:schema:kicad_monkey.footprint_read.result:a0",
    "type": "object",
    "properties": {
        "type": {
            "type": "string",
            "const": "kicad_monkey.footprint_read.result"
        },
        "version": {
            "type": "string",
            "const": "a0"
        },
        "name": {
            "type": "string"
        },
        "source_bytes": {
            "type": "string"
        },
        "properties": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/FootprintProperty"
            }
        },
        "pad_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295
        },
        "diagnostics": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/Diagnostic"
            }
        }
    },
    "required": [
        "type",
        "version",
        "name",
        "source_bytes",
        "properties",
        "pad_count",
        "diagnostics"
    ],
    "unevaluatedProperties": {
        "not": {}
    },
    "description": "Typed footprint facts; KiCad source bytes remain in the caller-owned input.",
    "title": "Footprint read result a0",
    "$defs": {
        "FootprintProperty": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "name",
                "value"
            ],
            "unevaluatedProperties": {
                "not": {}
            },
            "description": "One decoded top-level KiCad footprint property."
        },
        "Diagnostic": {
            "type": "object",
            "properties": {
                "phase": {
                    "$ref": "#/$defs/DiagnosticPhase"
                },
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "position": {
                    "$ref": "#/$defs/SourcePosition"
                },
                "token": {
                    "type": "string"
                }
            },
            "required": [
                "phase",
                "code",
                "message"
            ],
            "unevaluatedProperties": {
                "not": {}
            },
            "description": "Stable operation diagnostic shared by native, Python, and browser adapters."
        },
        "DiagnosticPhase": {
            "type": "string",
            "enum": [
                "lex",
                "tree",
                "build"
            ]
        },
        "SourcePosition": {
            "type": "object",
            "properties": {
                "offset": {
                    "type": "string"
                },
                "line": {
                    "type": "string"
                },
                "column": {
                    "type": "string"
                }
            },
            "required": [
                "offset",
                "line",
                "column"
            ],
            "unevaluatedProperties": {
                "not": {}
            },
            "description": "Zero-based UTF-8 byte offset with one-based source coordinates."
        }
    }
}