Skip to content

Commit 1283821

Browse files
NPA-3895: Created make command
1 parent 586ec7c commit 1283821

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,38 @@ smoketest-prod:
8383
test-prod:
8484
$(PROD_CMD) \
8585
--junitxml=test-report.xml \
86+
87+
# Run schema validation check
88+
89+
schema-consent:
90+
91+
@for file in specification/examples/responses/GET_Consent/*.yaml; do \
92+
if [ "$$file" = "specification/examples/responses/GET_Consent/filtered-relationships-status-active-include-details.yaml" ]; then \
93+
continue; \
94+
fi; \
95+
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-patient.yaml" ]; then \
96+
continue; \
97+
fi; \
98+
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-performer-patient.yaml" ]; then \
99+
continue; \
100+
fi; \
101+
if [ "$$file" = "specification/examples/responses/GET_Consent/multiple-relationships-include-performer.yaml" ]; then \
102+
continue; \
103+
fi; \
104+
if [ "$$file" = "specification/examples/responses/GET_Consent/single-consenting-adult-relationship-include-performer-patient.yaml" ]; then \
105+
continue; \
106+
fi; \
107+
if [ "$$file" = "specification/examples/responses/GET_Consent/single-mother-child-relationship-include-performer-patient.yaml" ]; then \
108+
continue; \
109+
fi; \
110+
echo "Processing $$file"; \
111+
poetry run python scripts/validate_schema.py consent "$$(realpath $$file)"; \
112+
done
113+
114+
115+
# cd scripts
116+
117+
# $(foreach file, $(FILES), poetry run python scripts/validate_schema.py consent $(file)";)
118+
#
119+
# @for file in ../specification/examples/responses/GET_Consent/*.yaml; do echo $$file; done
120+
# @for file in ../specification/examples/responses/GET_Consent/*.yaml; do poetry run python scripts/validate_schema.py consent $$file; done

scripts/validate_schema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import datetime
1212
import sys
1313

14+
EXAMPLES_PATH = "../"
1415
SCHEMA_FILE_PATH = "../specification/validated-relationships-service-api.yaml"
1516
SCHEMA_FILE = path.join(path.dirname(path.realpath(__file__)), SCHEMA_FILE_PATH)
1617
openapi_schema = {}
@@ -19,6 +20,9 @@
1920
def main(openapi_schema: dict):
2021
"""Main entrypoint"""
2122
args = sys.argv
23+
print("args:")
24+
print(args)
25+
print("******")
2226
if len(args) != 3:
2327
print("Require schema reference and file to validate")
2428
exit()

specification/validated-relationships-service-api.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,8 +1594,6 @@ components:
15941594
scope:
15951595
$ref: '#/components/schemas/CodeableConcept'
15961596
description: "The scope of the consent, bound to http://terminology.hl7.org/CodeSystem/consentscope"
1597-
enum:
1598-
- patient-privacy
15991597
category:
16001598
type: array
16011599
items:

0 commit comments

Comments
 (0)