Skip to content

Commit

Permalink
schema: statementType should not have codelist options
Browse files Browse the repository at this point in the history
  • Loading branch information
jarofgreen committed Nov 9, 2021
1 parent 9fd3a49 commit 2ee78ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 1 addition & 3 deletions schema/entity-statement.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"enum": [
"entityStatement"
],
"propertyOrder": 2,
"openCodelist": false,
"codelist": "statementType.csv"
"propertyOrder": 2
},
"statementDate": {
"$ref": "components.json#/definitions/StatementDate",
Expand Down
4 changes: 1 addition & 3 deletions schema/ownership-or-control-statement.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"type": "string",
"enum": [
"ownershipOrControlStatement"
],
"openCodelist": false,
"codelist": "statementType.csv"
]
},
"statementDate": {
"$ref": "components.json#/definitions/StatementDate"
Expand Down
4 changes: 1 addition & 3 deletions schema/person-statement.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"enum": [
"personStatement"
],
"propertyOrder": 2,
"openCodelist": false,
"codelist": "statementType.csv"
"propertyOrder": 2
},
"statementDate": {
"$ref": "components.json#/definitions/StatementDate",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ def test_codelists_used():
unused_codelists = [codelist for codelist in codelist_files if codelist not in codelists]
missing_codelists = [codelist for codelist in codelists if codelist not in codelist_files]

# because of how we use subschemas and how we use the statementType field to select which subschema to use,
# we can't reference the statementType.csv directly from the schema. But it is used in building the docs.
# See https://github.com/openownership/data-standard/issues/375
unused_codelists.remove('statementType.csv')

assert len(unused_codelists) == 0, "Codelist files found not in schema: {}".format(unused_codelists)
assert len(missing_codelists) == 0, "Codelists in schema missing CSVs: {}".format(missing_codelists)

Expand Down

0 comments on commit 2ee78ff

Please sign in to comment.