Root Key Names Are Unique

Root Key Names Are Unique is a Context Constraint that checks every definition to ensure there are no duplicate root keys defined in the AaC language.

Usage Example

The below example would fail the Root Key Names Are Unique because the referenced root one has more than one definition of itself.

BAD_ROOTS = """
schema:
  name: One
  package: test.root_keys
  root: one
  fields:
    - name: name
      type: string
---
schema:
  name: Two
  package: test.root_keys
  root: one
  fields:
    - name: name

In this example, each referenced root has only one definition of itself, and so would pass this constraint.

GOOD_ROOTS = """
schema:
  name: One
  package: test.root_keys
  root: one
  fields:
    - name: name
      type: string
---
schema:
  name: Two
  package: test.root_keys
  root: two
  fields:
    - name: name