{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"$id": "https://m.canouil.dev/quarto-wizard/assets/schema/v2/extension-schema.json",
	"title": "Quarto Extension Schema Definition (v2)",
	"description": "Describes the structure of _schema.yml / _schema.json files used by Quarto extensions. v2 uses JSON Schema canonical names (camelCase, minimum/maximum/multipleOf/...) exclusively and drops the dual-key vocabulary of v1.",
	"$comment": "Custom annotations used inside property descriptors: x-yaml-hidden (property is not surfaced in YAML completion menus); x-boolean-property (treat as boolean for snippet purposes even if it accepts other types); x-nested-property (property holds a nested schema or schemas); x-snippet (override the YAML completion snippet); x-shortcode-argument-only (property only valid inside shortcode argument descriptors). These annotations are no-ops for generic JSON Schema 2020-12 validators.",
	"type": "object",
	"additionalProperties": false,
	"properties": {
		"$schema": {
			"type": "string",
			"format": "uri",
			"pattern": "^https://m\\.canouil\\.dev/quarto-wizard/assets/schema/v[0-9]+/extension-schema\\.json$",
			"description": "Schema version URI."
		},
		"options": {
			"$ref": "#/$defs/fieldDescriptorMap",
			"description": "Extension-level configuration options."
		},
		"shortcodes": {
			"$ref": "#/$defs/shortcodeMap",
			"description": "Per-shortcode schemas."
		},
		"formats": {
			"$ref": "#/$defs/formatsMap",
			"description": "Per-format options."
		},
		"projects": {
			"type": "array",
			"items": { "type": "string" },
			"uniqueItems": true,
			"description": "Project types contributed by the extension (suggested for project.type)."
		},
		"attributes": {
			"$ref": "#/$defs/attributesMap",
			"description": "Attributes accepted by filter extensions on Pandoc elements, grouped by class, ID, or element type."
		},
		"classes": {
			"$ref": "#/$defs/classesMap",
			"description": "CSS classes contributed by the extension, with optional descriptions."
		}
	},
	"$defs": {
		"typeEnum": {
			"type": "string",
			"enum": ["string", "number", "integer", "boolean", "array", "object", "null", "content"]
		},
		"completionSpec": {
			"type": "object",
			"additionalProperties": false,
			"description": "Completion specification for the field.",
			"properties": {
				"type": {
					"type": "string",
					"enum": ["enum", "file", "directory", "color", "boolean", "freeform", "size", "none"],
					"description": "Completion type."
				},
				"extensions": {
					"type": "array",
					"items": { "type": "string" },
					"description": "File extensions to filter by (for type: file)."
				},
				"placeholder": {
					"type": "string",
					"description": "Placeholder text (for type: freeform)."
				},
				"values": {
					"type": "array",
					"items": { "type": "string" },
					"description": "Static value list (for type: enum)."
				},
				"dynamic": {
					"type": "boolean",
					"description": "Whether values are resolved dynamically."
				},
				"source": {
					"type": "string",
					"description": "Source identifier for dynamic values."
				}
			}
		},
		"deprecatedSpec": {
			"type": "object",
			"additionalProperties": false,
			"description": "Structured deprecation descriptor.",
			"properties": {
				"since": {
					"type": "string",
					"description": "Version since which the field is deprecated."
				},
				"message": {
					"type": "string",
					"description": "Deprecation message."
				},
				"replaceWith": {
					"type": "string",
					"description": "Replacement field name."
				}
			}
		},
		"fieldDescriptor": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"type": {
					"description": "Data type (string, number, integer, boolean, array, object, null, content).",
					"oneOf": [
						{ "$ref": "#/$defs/typeEnum" },
						{
							"type": "array",
							"items": { "$ref": "#/$defs/typeEnum" },
							"minItems": 1,
							"uniqueItems": true
						}
					]
				},
				"required": {
					"type": "boolean",
					"description": "Whether this field is required (field-local boolean form, Quarto Wizard extension)."
				},
				"default": {
					"description": "Default value when not specified."
				},
				"description": {
					"type": "string",
					"description": "Human-readable description shown in editor hints."
				},
				"title": {
					"type": "string",
					"description": "Short human-readable label."
				},
				"examples": {
					"type": "array",
					"description": "Example values for documentation and tooling."
				},
				"format": {
					"type": "string",
					"description": "JSON Schema format hint (e.g., uri, email, date-time). Annotation only."
				},
				"multipleOf": {
					"type": "number",
					"exclusiveMinimum": 0,
					"description": "Value must be a positive multiple of this number."
				},
				"enum": {
					"type": "array",
					"uniqueItems": true,
					"description": "List of allowed values.",
					"x-snippet": ":\n  - $0"
				},
				"enumCaseInsensitive": {
					"type": "boolean",
					"description": "Whether enum matching ignores case."
				},
				"pattern": {
					"type": "string",
					"description": "Regular expression the value must match. Use `^...$` to anchor."
				},
				"minimum": {
					"type": "number",
					"description": "Minimum numeric value (inclusive)."
				},
				"maximum": {
					"type": "number",
					"description": "Maximum numeric value (inclusive)."
				},
				"exclusiveMinimum": {
					"type": "number",
					"description": "Exclusive minimum (value must be strictly greater)."
				},
				"exclusiveMaximum": {
					"type": "number",
					"description": "Exclusive maximum (value must be strictly less)."
				},
				"minLength": {
					"type": "integer",
					"description": "Minimum string length."
				},
				"maxLength": {
					"type": "integer",
					"description": "Maximum string length."
				},
				"minItems": {
					"type": "integer",
					"description": "Minimum number of items (for arrays)."
				},
				"maxItems": {
					"type": "integer",
					"description": "Maximum number of items (for arrays)."
				},
				"additionalProperties": {
					"description": "Whether object values may contain keys beyond those in `properties`. Boolean or a nested field descriptor.",
					"oneOf": [
						{ "type": "boolean" },
						{ "$ref": "#/$defs/fieldDescriptor" }
					]
				},
				"propertyNames": {
					"type": "string",
					"description": "Regular expression all object keys must match."
				},
				"dependentRequired": {
					"type": "object",
					"additionalProperties": {
						"type": "array",
						"items": { "type": "string" },
						"uniqueItems": true
					},
					"description": "When a key is present, also require the listed keys."
				},
				"contentEncoding": {
					"type": "string",
					"description": "Content encoding for the string value (e.g., base64)."
				},
				"contentMediaType": {
					"type": "string",
					"description": "Media type of the string content (e.g., application/json)."
				},
				"const": {
					"description": "Fixed value the field must equal."
				},
				"aliases": {
					"type": "array",
					"items": { "type": "string" },
					"description": "Alternative names for the field.",
					"x-snippet": ":\n  - $0"
				},
				"deprecated": {
					"description": "Whether the field is deprecated.",
					"x-boolean-property": true,
					"oneOf": [
						{ "type": "boolean" },
						{ "type": "string" },
						{ "$ref": "#/$defs/deprecatedSpec" }
					]
				},
				"completion": {
					"$ref": "#/$defs/completionSpec",
					"description": "Completion specification for the field.",
					"x-nested-property": true
				},
				"items": {
					"$ref": "#/$defs/fieldDescriptor",
					"description": "Schema for array items (when type is array).",
					"x-nested-property": true
				},
				"properties": {
					"$ref": "#/$defs/fieldDescriptorMap",
					"description": "Schema for nested object properties (when type is object).",
					"x-nested-property": true
				},
				"name": {
					"type": "string",
					"description": "Name of the shortcode argument (required).",
					"x-shortcode-argument-only": true
				}
			}
		},
		"fieldDescriptorMap": {
			"type": "object",
			"additionalProperties": {
				"$ref": "#/$defs/fieldDescriptor"
			}
		},
		"shortcodeArgument": {
			"allOf": [
				{ "$ref": "#/$defs/fieldDescriptor" },
				{
					"type": "object",
					"required": ["name"],
					"properties": {
						"name": { "type": "string" }
					}
				}
			],
			"description": "A shortcode positional argument. Inherits all field descriptor properties and requires `name`."
		},
		"shortcodeEntry": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"description": {
					"type": "string",
					"description": "Human-readable description of the shortcode."
				},
				"arguments": {
					"type": "array",
					"items": { "$ref": "#/$defs/shortcodeArgument" },
					"description": "Positional arguments accepted by the shortcode.",
					"x-nested-property": true,
					"x-snippet": ":\n  - $0"
				},
				"attributes": {
					"$ref": "#/$defs/fieldDescriptorMap",
					"description": "Named attributes accepted by the shortcode.",
					"x-nested-property": true,
					"x-snippet": ":\n  $0"
				},
				"required": {
					"type": "array",
					"items": { "type": "string" },
					"uniqueItems": true,
					"description": "Parent-level required list (JSON Schema canonical form, names of required attributes)."
				}
			}
		},
		"shortcodeMap": {
			"type": "object",
			"additionalProperties": {
				"$ref": "#/$defs/shortcodeEntry"
			}
		},
		"formatsMap": {
			"type": "object",
			"additionalProperties": {
				"$ref": "#/$defs/fieldDescriptorMap"
			}
		},
		"attributesMap": {
			"type": "object",
			"additionalProperties": {
				"$ref": "#/$defs/fieldDescriptorMap"
			}
		},
		"classEntry": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"description": {
					"type": "string",
					"description": "Human-readable description of the class."
				}
			}
		},
		"classesMap": {
			"type": "object",
			"additionalProperties": {
				"$ref": "#/$defs/classEntry"
			}
		}
	}
}
