It is possible to create small partial schemas that can be included in other schemas.
This feature do not use any built-in
To define a partial schema use the keyword
(schema-id) name must be globally unique. If collisions is detected then error will be raised.
To use a partial schema use the keyword
include: (schema-id):. This will work at any place you can specify the keyword
type. Include directive do not currently work inside a partial schema.
It is possible to define any number of partial schemas in any schema file as long as they are defined at top level of the schema.
For example, this schema contains one partial and the regular schema.
# Schema schema;map_str: type: map mapping: foo: type: str type: seq sequence: - include: map_str
# Data - foo: opa
Partial schemas section for details.
Names must be globally unique.
# Schema schema;list_str: type: seq sequence: - type: str schema;list_int: type: seq sequence: - type: int
partial schema system. Includes are lazy and are loaded during parsing / validation.
# Schema [barfoo.yaml] schema;list_str: type: seq sequence: - type: str
# Schema [foobar.yaml] include: list_str
# Data - foobar