No Extension For Final¶
No Extension For Final
is a Schema Constraint that checks every schema for extension entries that are marked with a final
modifier.
Usage Example¶
In the below example, TestChild
is validly extending TestParent
.
root_schema_with_good_ext = """
schema:
name: TestParent
package: test_aac.plugins.no_ext_for_final
fields:
- name: name
type: string
- name: test_field
type: string
---
schema:
name: TestChild
package: test_aac.plugins.no_ext_for_final
extends:
- name: TestParent
package: test_aac.plugins.no_ext_for_final
fields:
- name: name
type: string
- name: test_field
However, in this example TestParent
now has the final
modifier, so defining TestChild
as an extension is invalid and will fail the No Extension For Final
constraint.
root_schema_with_bad_ext_circular = """
schema:
name: TestParent
package: test_aac.plugins.no_ext_for_final
modifiers:
- final
fields:
- name: name
type: string
- name: test_field
type: string
---
schema:
name: TestChild
package: test_aac.plugins.no_ext_for_final
extends:
- name: TestParent
package: test_aac.plugins.no_ext_for_final
fields:
- name: name
type: string
- name: test_field