Skip to content

Commit 91196f5

Browse files
JackPlowmanlelliott-hippo
authored andcommitted
NPA-5357: Update Postman Collection and Sandbox for ID
1 parent 8f158c1 commit 91196f5

File tree

5 files changed

+83
-83
lines changed

5 files changed

+83
-83
lines changed

postman/Validate Relationship Service Sandbox.postman_collection.json

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "This Postman collection includes example scenarios for each of the Validated Relationship Service (VRS) API endpoints, covering both valid and invalid request scenarios.\n\nThe collection is pointed towards the VRS sandbox environment, which will return a specific example response based on the request sent. All data shown in the requests or responses is test data.\n\nOur sandbox environment only covers the scenarios listed in the Postman collection and is open access. It does not allow you to test authorisation or any scenarios beyond the ones documented.\n\nFull specification is available at [https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service](https://digital.nhs.uk/developer/api-catalogue/validated-relationship-service)",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
77
"_exporter_id": "34042403",
8-
"_collection_link": "https://www.postman.com/jackplowman2/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403"
8+
"_collection_link": "https://www.postman.com/jackplowman2/workspace/validate-relationship-service-sandbox-03-09-25/collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=share&source=collection_link&creator=34042403"
99
},
1010
"item": [
1111
{
@@ -231,7 +231,7 @@
231231
}
232232
],
233233
"url": {
234-
"raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=19318ZGLAB",
234+
"raw": "{{api_base_url}}/QuestionnaireResponse?ID=156e1560-e532-4e2a-85ad-5aeff03dc43e",
235235
"host": [
236236
"{{api_base_url}}"
237237
],
@@ -240,8 +240,8 @@
240240
],
241241
"query": [
242242
{
243-
"key": "referenceCode",
244-
"value": "19318ZGLAB"
243+
"key": "ID",
244+
"value": "156e1560-e532-4e2a-85ad-5aeff03dc43e"
245245
}
246246
]
247247
},
@@ -257,23 +257,23 @@
257257
"script": {
258258
"exec": [
259259
"const expectedResponseBody = {",
260-
" \"resourceType\": \"OperationOutcome\",",
261-
" \"issue\": [",
262-
" {",
263-
" \"severity\": \"error\",",
264-
" \"code\": \"required\",",
265-
" \"details\": {",
266-
" \"coding\": [",
267-
" {",
268-
" \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",",
269-
" \"code\": \"MISSING_REFERENCE_CODE\",",
270-
" \"display\": \"Missing reference code\"",
271-
" }",
272-
" ]",
273-
" },",
274-
" \"diagnostics\": \"The reference code parameter is required but was not provided.\"",
275-
" }",
276-
" ]",
260+
" \"resourceType\": \"OperationOutcome\",",
261+
" \"issue\": [",
262+
" {",
263+
" \"severity\": \"error\",",
264+
" \"code\": \"required\",",
265+
" \"details\": {",
266+
" \"coding\": [",
267+
" {",
268+
" \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",",
269+
" \"code\": \"BAD_REQUEST\",",
270+
" \"display\": \"Bad request\"",
271+
" }",
272+
" ]",
273+
" },",
274+
" \"diagnostics\": \"The access request ID parameter is required but was not provided.\"",
275+
" }",
276+
" ]",
277277
"};",
278278
"",
279279
"pm.test(\"Status code is 400\", function () {",
@@ -325,23 +325,23 @@
325325
"script": {
326326
"exec": [
327327
"const expectedResponseBody = {",
328-
" \"resourceType\": \"OperationOutcome\",",
329-
" \"issue\": [",
330-
" {",
331-
" \"severity\": \"error\",",
332-
" \"code\": \"invalid\",",
333-
" \"details\": {",
334-
" \"coding\": [",
335-
" {",
336-
" \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",",
337-
" \"code\": \"INVALID_REFERENCE_CODE\",",
338-
" \"display\": \"Invalid reference code\"",
339-
" }",
340-
" ]",
341-
" },",
342-
" \"diagnostics\": \"The specified reference code format is invalid. Reference codes must be alphanumeric.\"",
343-
" }",
344-
" ]",
328+
" \"resourceType\": \"OperationOutcome\",",
329+
" \"issue\": [",
330+
" {",
331+
" \"severity\": \"error\",",
332+
" \"code\": \"required\",",
333+
" \"details\": {",
334+
" \"coding\": [",
335+
" {",
336+
" \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",",
337+
" \"code\": \"BAD_REQUEST\",",
338+
" \"display\": \"Bad request\"",
339+
" }",
340+
" ]",
341+
" },",
342+
" \"diagnostics\": \"The access request ID parameter is required but was not provided.\"",
343+
" }",
344+
" ]",
345345
"};",
346346
"",
347347
"pm.test(\"Status code is 400\", function () {",
@@ -399,23 +399,23 @@
399399
"script": {
400400
"exec": [
401401
"const expectedResponseBody = {",
402-
" \"resourceType\": \"OperationOutcome\",",
403-
" \"issue\": [",
404-
" {",
405-
" \"severity\": \"error\",",
406-
" \"code\": \"not-found\",",
407-
" \"details\": {",
408-
" \"coding\": [",
409-
" {",
410-
" \"system\": \"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode\",",
411-
" \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",",
412-
" \"display\": \"Questionnaire response not found\"",
413-
" }",
414-
" ]",
415-
" },",
416-
" \"diagnostics\": \"The Questionnaire response could not be found using the provided reference code.\"",
417-
" }",
418-
" ]",
402+
" \"resourceType\": \"OperationOutcome\",",
403+
" \"issue\": [",
404+
" {",
405+
" \"severity\": \"error\",",
406+
" \"code\": \"not-found\",",
407+
" \"details\": {",
408+
" \"coding\": [",
409+
" {",
410+
" \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1\",",
411+
" \"code\": \"QUESTIONNAIRE_RESPONSE_NOT_FOUND\",",
412+
" \"display\": \"Questionnaire response not found\"",
413+
" }",
414+
" ]",
415+
" },",
416+
" \"diagnostics\": \"The Questionnaire response could not be found using the provided access request ID.\"",
417+
" }",
418+
" ]",
419419
"};",
420420
"",
421421
"pm.test(\"Status code is 404\", function () {",
@@ -447,7 +447,7 @@
447447
}
448448
],
449449
"url": {
450-
"raw": "{{api_base_url}}/QuestionnaireResponse?referenceCode=ABC123XY",
450+
"raw": "{{api_base_url}}/QuestionnaireResponse?ID=60d09b82-f4bb-41f9-b41e-767999b4ac9b",
451451
"host": [
452452
"{{api_base_url}}"
453453
],
@@ -456,8 +456,8 @@
456456
],
457457
"query": [
458458
{
459-
"key": "referenceCode",
460-
"value": "ABC123XY"
459+
"key": "ID",
460+
"value": "60d09b82-f4bb-41f9-b41e-767999b4ac9b"
461461
}
462462
]
463463
},
@@ -487,8 +487,8 @@
487487
" \"details\": {",
488488
" \"coding\": [",
489489
" {",
490-
" \"code\": \"19318ZGLAB\",",
491-
" \"display\": \"19318ZGLAB\"",
490+
" \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",",
491+
" \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"",
492492
" }",
493493
" ]",
494494
" }",
@@ -567,8 +567,8 @@
567567
" \"details\": {",
568568
" \"coding\": [",
569569
" {",
570-
" \"code\": \"19318ZGLAB\",",
571-
" \"display\": \"19318ZGLAB\"",
570+
" \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",",
571+
" \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"",
572572
" }",
573573
" ]",
574574
" }",
@@ -713,8 +713,8 @@
713713
" \"details\": {",
714714
" \"coding\": [",
715715
" {",
716-
" \"code\": \"19318ZGLAB\",",
717-
" \"display\": \"19318ZGLAB\"",
716+
" \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",",
717+
" \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"",
718718
" }",
719719
" ]",
720720
" }",
@@ -792,8 +792,8 @@
792792
" \"details\": {",
793793
" \"coding\": [",
794794
" {",
795-
" \"code\": \"19318ZGLAB\",",
796-
" \"display\": \"19318ZGLAB\"",
795+
" \"code\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\",",
796+
" \"display\": \"156e1560-e532-4e2a-85ad-5aeff03dc43e\"",
797797
" }",
798798
" ]",
799799
" }",

sandbox/api/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
# GET QuestionnaireResponse
101101
GET_QUESTIONNAIRE_RESPONSE_DIRECTORY = "./api/examples/GET_QuestionnaireResponse/"
102102
GET_QUESTIONNAIRE_RESPONSE__SUCCESS = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}success.yaml"
103-
GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_access_request_uuid.yaml"
104-
GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_access_request_uuid.yaml"
103+
GET_QUESTIONNAIRE_RESPONSE__INVALID = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/invalid_access_request_id.yaml"
104+
GET_QUESTIONNAIRE_RESPONSE__MISSING = f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/missing_access_request_id.yaml"
105105
GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND = (
106106
f"{GET_QUESTIONNAIRE_RESPONSE_DIRECTORY}errors/questionnaire_response_not_found.yaml"
107107
)

sandbox/api/get_questionnaire_response.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ def get_questionnaire_response_response() -> Union[dict, tuple]:
2323
Union[dict, tuple]: Response for GET /QuestionnaireResponse
2424
"""
2525
try:
26-
access_request_uuid = request.args.get("accessRequestUUID")
27-
if access_request_uuid == "156e1560-e532-4e2a-85ad-5aeff03dc43e":
26+
access_request_id = request.args.get("ID")
27+
if access_request_id == "156e1560-e532-4e2a-85ad-5aeff03dc43e":
2828
return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__SUCCESS, 200)
29-
elif access_request_uuid == "INVALID":
29+
elif access_request_id == "INVALID":
3030
return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__INVALID, 400)
31-
elif access_request_uuid == "" or access_request_uuid is None:
31+
elif access_request_id == "" or access_request_id is None:
3232
return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__MISSING, 400)
33-
elif access_request_uuid == "60d09b82-f4bb-41f9-b41e-767999b4ac9b":
33+
elif access_request_id == "60d09b82-f4bb-41f9-b41e-767999b4ac9b":
3434
return generate_response_from_example(GET_QUESTIONNAIRE_RESPONSE__NOT_FOUND, 404)
3535
else:
36-
raise ValueError("Invalid access request UUID")
36+
raise ValueError("Invalid access request ID")
3737
except Exception:
3838
logger.exception("GET questionnaire response failed")
3939
return generate_response_from_example(INTERNAL_SERVER_ERROR_EXAMPLE, 500)

sandbox/api/tests/test_get_questionnaire_response.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
("request_args", "response_file_name", "status_code"),
1111
[
1212
(
13-
"accessRequestUUID=156e1560-e532-4e2a-85ad-5aeff03dc43e",
13+
"ID=156e1560-e532-4e2a-85ad-5aeff03dc43e",
1414
"./api/examples/GET_QuestionnaireResponse/success.yaml",
1515
200,
1616
),
1717
(
18-
"accessRequestUUID=INVALID",
19-
"./api/examples/GET_QuestionnaireResponse/errors/invalid_access_request_uuid.yaml",
18+
"ID=INVALID",
19+
"./api/examples/GET_QuestionnaireResponse/errors/invalid_access_request_id.yaml",
2020
400,
2121
),
2222
(
23-
"accessRequestUUID=",
24-
"./api/examples/GET_QuestionnaireResponse/errors/missing_access_request_uuid.yaml",
23+
"ID=",
24+
"./api/examples/GET_QuestionnaireResponse/errors/missing_access_request_id.yaml",
2525
400,
2626
),
2727
(
28-
"accessRequestUUID=60d09b82-f4bb-41f9-b41e-767999b4ac9b",
28+
"ID=60d09b82-f4bb-41f9-b41e-767999b4ac9b",
2929
"./api/examples/GET_QuestionnaireResponse/errors/questionnaire_response_not_found.yaml",
3030
404,
3131
),
3232
(
33-
"accessRequestUUID=INVALID_CODE",
33+
"ID=INVALID_CODE",
3434
"./api/examples/errors/internal-server-error.yaml",
3535
500,
3636
),

specification/validated-relationships-service-api.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ info:
141141
* only covers a limited set of scenarios
142142
* is open access, so does not allow you to test authorisation
143143
144-
[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman" style="width: 128px; height: 32px;">](https://app.getpostman.com/run-collection/18067099-679cd3dc-8b52-4699-84e3-499fce3d7e15?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D18067099-679cd3dc-8b52-4699-84e3-499fce3d7e15%26entityType%3Dcollection%26workspaceId%3D8a8e66e5-71af-4830-9f29-9d98cbec443a)
144+
[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman" style="width: 128px; height: 32px;">](https://app.getpostman.com/run-collection/34042403-298358e5-ad8f-4875-a8e3-acb4600712f0?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D34042403-298358e5-ad8f-4875-a8e3-acb4600712f0%26entityType%3Dcollection%26workspaceId%3D0e2260b3-ef5a-4ac7-a458-4fea08d8b726)
145145
146146
### Integration testing
147147
@@ -344,7 +344,7 @@ paths:
344344
| ----------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
345345
| 400 | `INVALID_IDENTIFIER_VALUE` | The access request ID must be a valid uuid. |
346346
| 400 | `INVALID_VALUE` | Invalid Parameter or Invalid operation. |
347-
| 400 | `BAD_REQUEST`. | The access request ID is required but was not provided in the request. |
347+
| 400 | `BAD_REQUEST` | The access request ID is required but was not provided in the request. |
348348
| 400 | `MISSING_VALUE` | Missing header or parameter. For details, see the `diagnostics` field. |
349349
| 401 | `ACCESS_DENIED` | Missing or invalid OAuth 2.0 bearer token in request. |
350350
| 403 | `FORBIDDEN` | Access denied to resource. |

0 commit comments

Comments
 (0)