From 4068cb1dfa95158149bba9fbf704bd448036ce16 Mon Sep 17 00:00:00 2001 From: Tom Knapp Date: Mon, 2 Mar 2026 16:16:56 +0000 Subject: [PATCH 1/4] NPA-6466: Service Specification Update - Only include values that are actually returned in OperationOutcome -> code (FHIR error code) --- .../validated-relationships-service-api.yaml | 36 ++++--------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index f58adc7d..8ccc3a13 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -152,7 +152,7 @@ info: [![Import Postman Collection](https://img.shields.io/badge/Import-Postman%20Collection-orange?logo=postman)](https://raw.githubusercontent.com/NHSDigital/validated-relationships-service-api/master/postman/validated_relationship_service.sandbox.postman_collection.json) Import the postman collection to run requests against sandbox. - + ### Integration testing Our [integration test environment](https://digital.nhs.uk/developer/guides-and-documentation/testing#integration-testing) @@ -2511,37 +2511,13 @@ components: type: string description: FHIR error code. enum: - - invalid - - structure - - required - - value - - invariant - - security - - login - - unknown - - expired - - forbidden - - suppressed - - processing - - not-supported - - duplicate - - multiple-matches - - not-found - - deleted - - too-long - - code-invalid - - extension - - too-costly - - business-rule - - conflict - - transient - - lock-error - - no-store - exception - - timeout - - incomplete - - throttled + - forbidden - informational + - invalid + - not-supported + - processing + - required details: type: object description: Internal error code. From ecf56c718bc1147209429c7c0594a7f601813745 Mon Sep 17 00:00:00 2001 From: Tom Knapp Date: Tue, 3 Mar 2026 17:16:49 +0000 Subject: [PATCH 2/4] NPA-6466: specification; reinstate not-found OperationOutcome code; fix OperationOutcome expression to be type array, items string --- specification/validated-relationships-service-api.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 8ccc3a13..ddbff7cb 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -2515,6 +2515,7 @@ components: - forbidden - informational - invalid + - not-found - not-supported - processing - required @@ -2543,8 +2544,10 @@ components: type: string description: Additional diagnostic information about the issue. This information is subject to change. expression: - type: string + type: array description: FHIRPath of element(s) related to the error. + items: + type: string Reference: type: object From e50b89e5bdf020e832c94e0bc76ab35f7e959afd Mon Sep 17 00:00:00 2001 From: Tom Knapp Date: Tue, 3 Mar 2026 17:17:56 +0000 Subject: [PATCH 3/4] NPA-6466: fix Makefile to find and run all nested schema tests --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index a8b8477e..2a163c62 100644 --- a/Makefile +++ b/Makefile @@ -112,50 +112,50 @@ schema-all: schema-errors schema-get-consent: - @for file in specification/examples/responses/GET_Consent/*.yaml; do \ + @find specification/examples/responses/GET_Consent -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py consent "$$(realpath $$file)"; \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-post-consent: - @for file in specification/examples/responses/POST_Consent/*.yaml; do \ + @find specification/examples/responses/POST_Consent -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-patch-consent: - @for file in specification/examples/responses/PATCH_Consent/*.yaml; do \ + @find specification/examples/responses/PATCH_Consent -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-related-person: - @for file in specification/examples/responses/GET_RelatedPerson/*.yaml; do \ + @find specification/examples/responses/GET_RelatedPerson -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py relatedperson "$$(realpath $$file)"; \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-questionnaire: - @for file in specification/examples/responses/POST_QuestionnaireResponse/*.yaml; do \ + @find specification/examples/responses/POST_QuestionnaireResponse -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-errors: - @for file in specification/examples/responses/errors/*.yaml; do \ + @find specification/examples/responses/errors -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done schema-get-questionnaire: - @for file in specification/examples/responses/GET_QuestionnaireResponse/*.yaml; do \ + @find specification/examples/responses/GET_QuestionnaireResponse -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py questionnaireresponse "$$(realpath $$file)"; \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ echo -e "$(GREEN)Success!$(RESET)"; \ done From f9076914b11a4a55d69150439835d6ac323048f6 Mon Sep 17 00:00:00 2001 From: Tom Knapp Date: Thu, 5 Mar 2026 15:09:16 +0000 Subject: [PATCH 4/4] NPA-6466: fix Makefile pass expected schema objects to tests based on intended outcome --- Makefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2a163c62..359126ab 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,11 @@ schema-all: schema-get-consent: @find specification/examples/responses/GET_Consent -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + if echo "$$file" | grep -q "error"; then \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + else \ + poetry run python scripts/validate_schema.py consent "$$(realpath $$file)"; \ + fi; \ echo -e "$(GREEN)Success!$(RESET)"; \ done @@ -135,7 +139,11 @@ schema-patch-consent: schema-related-person: @find specification/examples/responses/GET_RelatedPerson -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + if echo "$$file" | grep -q "error"; then \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + else \ + poetry run python scripts/validate_schema.py relatedperson "$$(realpath $$file)"; \ + fi; \ echo -e "$(GREEN)Success!$(RESET)"; \ done @@ -156,6 +164,10 @@ schema-errors: schema-get-questionnaire: @find specification/examples/responses/GET_QuestionnaireResponse -name "*.yaml" -type f | while read file; do \ echo "Processing $$file"; \ - poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + if echo "$$file" | grep -q "error"; then \ + poetry run python scripts/validate_schema.py operationoutcome "$$(realpath $$file)"; \ + else \ + poetry run python scripts/validate_schema.py questionnaireresponse "$$(realpath $$file)"; \ + fi; \ echo -e "$(GREEN)Success!$(RESET)"; \ done