$schema: https://yaml-schema.net/yaml-schema.yaml
$id: https://yaml-schema.net/draft/2025-11/meta-schema
title: YAML Schema meta-schema
description: Meta-schema for YAML Schema, based on JSON Schema meta-schema
type: object
$defs:
  valid_types:
    description: A list of valid types
    type: string
    enum:
      # Scalars
      - boolean
      - integer
      - number
      - string
      - "null"
      # Complex Types
      - array
      - enum
      - object
  schema_type:
    description: >-
      The type of the schema
    oneOf:
      - $ref: "#/$defs/valid_types"
      - type: array
        items:
          $ref: "#/$defs/valid_types"
  schema:
    description: >-
      A meta schema for a YAML object schema
    type: object
    properties:
      type:
        $ref: "#/$defs/schema_type"
      properties:
        description: The properties that are defined in the schema
        type: object
        patternProperties:
          "^[a-zA-Z0-9_-]+$":
            $ref: "#/$defs/schema"
      description:
        type: string
      enum:
        description: An array of accepted values
        type: array
      const:
        description: A scalar value that must match the value
        type:
          - string
          - integer
          - number
          - boolean
      if:
        description: >-
          Subschema used only to choose whether `then` or `else` is applied; its assertion
          errors are not reported on the parent.
        $ref: "#/$defs/schema"
      then:
        description: Applied when the instance validates against `if`.
        $ref: "#/$defs/schema"
      else:
        description: Applied when the instance does not validate against `if`.
        $ref: "#/$defs/schema"
      dependentRequired:
        description: >-
          When a property named by a key is present, every string in the array must also
          be a property of the instance.
        type: object
        patternProperties:
          "^[a-zA-Z0-9_-]+$":
            type: array
            items:
              type: string
      dependentSchemas:
        description: >-
          When a property named by a key is present, the entire object instance must
          validate against the corresponding subschema.
        type: object
        patternProperties:
          "^[a-zA-Z0-9_-]+$":
            $ref: "#/$defs/schema"
  array_of_schemas:
    description: >-
      An array of schemas
    type: array
    items:
      $ref: "#/$defs/schema"
properties:
  $schema:
    description: Specifies which draft of the JSON Schema standard the schema adheres to.
    type: string
  $id:
    description: >-
      Sets a URI for the schema. You can use this unique URI to refer to elements of the
      schema from inside the same document or from external JSON documents.
    type: string
  $defs:
    description: A container for reusable JSON Schema fragments.
    type: object
    patternProperties:
      "^[a-zA-Z0-9_-]+$":
        $ref: "#/$defs/schema"
  title:
    description: >-
      The title of the schema
    type: string
  description:
    description: A description of the schema
    type: string
  type:
    description: defines the first constraint on the JSON data.
    $ref: "#/$defs/schema_type"
  properties:
    description: >-
      The properties that are defined in the schema
    type: object
    patternProperties:
      "^[a-zA-Z0-9_-]+$":
        $ref: "#/$defs/schema"
  additionalProperties:
    oneOf:
      - type: boolean
      - $ref: "#/$defs/array_of_schemas"
  not:
    $ref: "#/$defs/schema"
  oneOf:
    $ref: "#/$defs/array_of_schemas"
  allOf:
    $ref: "#/$defs/array_of_schemas"
  anyOf:
    $ref: "#/$defs/array_of_schemas"
  if:
    description: >-
      Subschema used only to choose whether `then` or `else` is applied; its assertion
      errors are not reported on the parent.
    $ref: "#/$defs/schema"
  then:
    description: Applied when the instance validates against `if`.
    $ref: "#/$defs/schema"
  else:
    description: Applied when the instance does not validate against `if`.
    $ref: "#/$defs/schema"
  dependentRequired:
    description: >-
      When a property named by a key is present, every string in the array must also be a
      property of the instance.
    type: object
    patternProperties:
      "^[a-zA-Z0-9_-]+$":
        type: array
        items:
          type: string
  dependentSchemas:
    description: >-
      When a property named by a key is present, the entire object instance must validate
      against the corresponding subschema.
    type: object
    patternProperties:
      "^[a-zA-Z0-9_-]+$":
        $ref: "#/$defs/schema"
  unevaluatedProperties:
    description: >-
      JSON Schema 2020-12 unevaluated vocabulary. Applies to object properties not already
      evaluated by properties, patternProperties, additionalProperties, or in-place applicators
      (e.g. allOf).
    oneOf:
      - type: boolean
      - $ref: "#/$defs/schema"
  unevaluatedItems:
    description: >-
      JSON Schema 2020-12 unevaluated vocabulary. Applies to array elements not already
      evaluated by prefixItems, items, contains, or in-place applicators.
    oneOf:
      - type: boolean
      - $ref: "#/$defs/schema"
additionalProperties: false
