Root Schema Has Name¶
Root Schema Has Name
is a Context Constraint that checks every schema with a root key and ensures there is a field called name
.
Usage Example¶
root_schema_without_name = """
schema:
name: test_schema
root: test_root
fields:
In the above example, test_schema
does not have a field called name
, and would fail the Root Schema Has Name
constraint. To pass this constraint, a field called name
would need to be added.
root_schema_with_name = """
schema:
name: test_schema
root: test_root
fields:
- name: name
type: string
In this example, a name
field has been added, allowing it to pass the constraint.