Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NRLF-646] Update swagger responses with error messages #114

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 187 additions & 0 deletions specification/record-locator/producer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,38 @@ paths:
code: RESOURCE_CREATED
display: Resource created
diagnostics: Resource created
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 400 | INVALID_RESOURCE_ID | Invalid resource ID |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
| 409 | INVALID_VALUE | Invalid value |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
requestBody:
$ref: "#/components/requestBodies/DocumentReference"
parameters:
Expand Down Expand Up @@ -502,6 +534,38 @@ paths:
$ref: "#/components/headers/CorrelationId"
X-Request-Id:
$ref: "#/components/headers/RequestId"
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 400 | INVALID_RESOURCE_ID | Invalid resource ID |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
| 409 | INVALID_VALUE | Invalid value |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
description: |
Search through document pointers.
Expand Down Expand Up @@ -699,6 +763,38 @@ paths:
$ref: "#/components/headers/CorrelationId"
X-Request-Id:
$ref: "#/components/headers/RequestId"
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 400 | INVALID_RESOURCE_ID | Invalid resource ID |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 403 | ACCESS_DENIED_LEVEL | Access has been denied because you need higher level permissions |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
| 409 | INVALID_VALUE | Invalid value |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
description: |
Search through document pointers.
Expand Down Expand Up @@ -802,6 +898,37 @@ paths:
$ref: "#/components/headers/CorrelationId"
X-Request-Id:
$ref: "#/components/headers/RequestId"
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 400 | INVALID_RESOURCE_ID | Invalid resource ID |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
| 409 | INVALID_VALUE | Invalid value |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
description: |
Read a single document pointer by specifying the `DocumentReference.id`. Note that you will only be able to
retrieve document pointers that have been created by the organisation specified in the `ODS-End-User-Organisation-ODS`
Expand Down Expand Up @@ -856,6 +983,37 @@ paths:
code: RESOURCE_UPDATED
display: Resource updated
diagnostics: Resource updated
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 400 | INVALID_RESOURCE_ID | Invalid resource ID |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
| 409 | INVALID_VALUE | Invalid value |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
requestBody:
$ref: "#/components/requestBodies/DocumentReference"
description: |
Expand Down Expand Up @@ -925,6 +1083,35 @@ paths:
code: RESOURCE_REMOVED
display: Resource removed
diagnostics: Resource removed
"4XX":
description: |
An error occurred as follows:
| HTTP status | Error code | Description |
| ----------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| 400 | BAD_REQUEST | Bad Request |
| 400 | VALIDATION_ERROR | A parameter or value has resulted in a validation error |
| 401 | ACCESS_DENIED | Access Denied |
| 403 | ACCESS_DENIED | Forbidden |
| 404 | RESOURCE_NOT_FOUND | Resource not found |
The Error Code comes from https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1
content:
application/fhir+json;version=1:
schema:
$ref: "#/components/schemas/OperationOutcome"
example:
resourceType: OperationOutcome
issue:
- severity: error
code: value
details:
coding:
- system: "https://fhir.nhs.uk/STU3/CodeSystem/Spine-ErrorOrWarningCode-1"
version: "1"
code: VALIDATION_ERROR
display: A parameter or value has resulted in a validation error
diagnostics: "The requested document pointer cannot be read because it belongs to another organisation"
description: |
Delete a single document pointer that your created.
components:
Expand Down
Loading