Skip to content

Commit

Permalink
Update swagger responses with error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jaklinger committed Aug 29, 2023
1 parent 1119b0f commit e2da96e
Showing 1 changed file with 187 additions and 0 deletions.
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

0 comments on commit e2da96e

Please sign in to comment.