{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://yii2-framework.github.io/docs/reference/reference.schema.json",
    "title": "Yii API reference catalog",
    "description": "One catalog per package (`/docs/reference/<package>.json`, the framework is `yii2.json`), generated by tools/bin/reference from the PHPDoc with yii2-apidoc. Types are PHP type strings without leading backslashes (`yii\\web\\View|null`); defaults and values are PHP expressions on one line; descriptions are the docblock summary with references written as inline code (`yii\\base\\Widget::begin()`). Member maps hold the members a type declares; `inherited` maps inherited member names to the type that declares them. Empty values, `false` flags and `public` visibility are omitted.",
    "type": "object",
    "required": [
        "schemaVersion",
        "package",
        "title",
        "repository",
        "ref",
        "commit",
        "generatedAt",
        "url",
        "types"
    ],
    "additionalProperties": false,
    "properties": {
        "$schema": { "type": "string", "format": "uri" },
        "schemaVersion": { "const": 1 },
        "package": {
            "type": "string",
            "description": "Name in packages.json (`yii2`, `bootstrap6`)."
        },
        "title": { "type": "string" },
        "repository": { "type": "string", "format": "uri" },
        "ref": {
            "type": "string",
            "description": "Branch or tag of the sources."
        },
        "commit": {
            "type": "string",
            "description": "Commit of the sources; `+worktree` marks a local working tree."
        },
        "generatedAt": { "type": "string", "format": "date" },
        "url": {
            "type": "string",
            "format": "uri",
            "description": "Reference index page of the package."
        },
        "types": {
            "type": "object",
            "description": "Types by fully qualified name.",
            "additionalProperties": { "$ref": "#/$defs/type" }
        }
    },
    "$defs": {
        "text": { "type": "string", "minLength": 1 },
        "deprecated": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "since": { "type": "string" },
                "reason": { "type": "string" }
            }
        },
        "names": {
            "type": "object",
            "description": "Member name to the fully qualified name of the type that declares it.",
            "additionalProperties": { "type": "string" }
        },
        "type": {
            "type": "object",
            "required": ["kind", "url"],
            "additionalProperties": false,
            "properties": {
                "kind": { "enum": ["class", "interface", "trait", "enum"] },
                "modifiers": {
                    "type": "array",
                    "items": { "enum": ["abstract", "final", "readonly"] }
                },
                "url": { "type": "string", "format": "uri" },
                "summary": { "$ref": "#/$defs/text" },
                "since": { "type": "string" },
                "deprecated": { "$ref": "#/$defs/deprecated" },
                "extends": { "type": "string" },
                "implements": {
                    "type": "array",
                    "items": { "type": "string" }
                },
                "traits": { "type": "array", "items": { "type": "string" } },
                "backingType": { "enum": ["int", "string"] },
                "cases": {
                    "type": "object",
                    "additionalProperties": { "$ref": "#/$defs/case" }
                },
                "properties": {
                    "type": "object",
                    "additionalProperties": { "$ref": "#/$defs/property" }
                },
                "methods": {
                    "type": "object",
                    "additionalProperties": { "$ref": "#/$defs/method" }
                },
                "constants": {
                    "type": "object",
                    "additionalProperties": { "$ref": "#/$defs/constant" }
                },
                "events": {
                    "type": "object",
                    "additionalProperties": { "$ref": "#/$defs/event" }
                },
                "inherited": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "properties": { "$ref": "#/$defs/names" },
                        "methods": { "$ref": "#/$defs/names" },
                        "constants": { "$ref": "#/$defs/names" },
                        "events": { "$ref": "#/$defs/names" }
                    }
                }
            }
        },
        "property": {
            "type": "object",
            "description": "Property keyed by its name without `$`; `virtual` marks `@property` tags and getters/setters.",
            "additionalProperties": false,
            "properties": {
                "type": { "type": "string" },
                "default": {
                    "type": "string",
                    "description": "PHP expression; absent when the property has no default (required constructor property, typed property, virtual property)."
                },
                "description": { "$ref": "#/$defs/text" },
                "visibility": { "const": "protected" },
                "static": { "const": true },
                "readonly": { "const": true },
                "access": { "enum": ["read-only", "write-only"] },
                "virtual": { "const": true },
                "promoted": {
                    "const": true,
                    "description": "Declared in the constructor signature."
                },
                "since": { "type": "string" },
                "deprecated": { "$ref": "#/$defs/deprecated" }
            }
        },
        "param": {
            "type": "object",
            "required": ["name"],
            "additionalProperties": false,
            "properties": {
                "name": { "type": "string", "pattern": "^\\$" },
                "type": { "type": "string" },
                "default": { "type": "string" },
                "optional": { "const": true },
                "variadic": { "const": true },
                "byReference": { "const": true },
                "description": { "$ref": "#/$defs/text" }
            }
        },
        "method": {
            "type": "object",
            "required": ["signature"],
            "additionalProperties": false,
            "properties": {
                "signature": {
                    "type": "string",
                    "description": "PHP signature with the documented (PHPDoc) types."
                },
                "summary": { "$ref": "#/$defs/text" },
                "params": {
                    "type": "array",
                    "items": { "$ref": "#/$defs/param" }
                },
                "return": {
                    "type": "object",
                    "required": ["type"],
                    "additionalProperties": false,
                    "properties": {
                        "type": { "type": "string" },
                        "description": { "$ref": "#/$defs/text" }
                    }
                },
                "throws": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "required": ["type"],
                        "additionalProperties": false,
                        "properties": {
                            "type": { "type": "string" },
                            "description": { "$ref": "#/$defs/text" }
                        }
                    }
                },
                "visibility": { "const": "protected" },
                "static": { "const": true },
                "abstract": { "const": true },
                "virtual": {
                    "const": true,
                    "description": "Declared by an `@method` tag."
                },
                "since": { "type": "string" },
                "deprecated": { "$ref": "#/$defs/deprecated" }
            }
        },
        "constant": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "value": { "type": "string" },
                "description": { "$ref": "#/$defs/text" },
                "since": { "type": "string" },
                "deprecated": { "$ref": "#/$defs/deprecated" }
            }
        },
        "event": {
            "type": "object",
            "description": "`EVENT_*` constant documented with `@event`; `value` is the event name and `type` the event class.",
            "additionalProperties": false,
            "properties": {
                "value": { "type": "string" },
                "type": { "type": "string" },
                "description": { "$ref": "#/$defs/text" },
                "since": { "type": "string" }
            }
        },
        "case": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "value": { "type": "string" },
                "description": { "$ref": "#/$defs/text" }
            }
        }
    }
}
