Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions sandbox/data/examples/errors/responses/bad-gateway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"message": "Bad Gateway"
}
20 changes: 8 additions & 12 deletions sandbox/data/examples/errors/responses/tooManyRequests.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"errors": [
{
"code": "NOTIFY_QUOTA",
"detail": "You have made too many requests. Please try again later.",
"id": "rrt-1931948104716186917-c-geu2-10664-3111479-3.0",
"links": {
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
},
"status": "429",
"title": "Too many requests"
}
]
"interval": 1,
"limit": 1,
"message": "Your application, Notify-Supplier-App-Restricted - Internal Dev 2, has exceeded its quota of 1 requests every 1 minute(s) and is being rate limited.",
"message_id": "rrt-4773181658036170775-c-geu2-321623-73628915-2",
"policy": "quota",
"ratelimiting_expiry_time_ms": 1765372560000,
"scope": "application",
"timeunit": "minute"
}
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/createMI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
'500':
$ref: "../responses/errors/serverError.yml"
'502':
$ref: "../responses/errors/badGateway.yml"
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/getDataId.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
"500":
$ref: "../responses/errors/serverError.yml"
"502":
$ref: "../responses/errors/badGateway.yml"
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/getLetterStatus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
"500":
$ref: "../responses/errors/serverError.yml"
"502":
$ref: "../responses/errors/badGateway.yml"
tags:
- letter
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/listLetters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
'500':
$ref: "../responses/errors/serverError.yml"
'502':
$ref: "../responses/errors/badGateway.yml"
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/patchLetter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
"500":
$ref: "../responses/errors/serverError.yml"
"502":
$ref: "../responses/errors/badGateway.yml"
tags:
- letter
2 changes: 2 additions & 0 deletions specification/api/components/endpoints/postLetters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ responses:
$ref: "../responses/errors/tooManyRequests.yml"
'500':
$ref: "../responses/errors/serverError.yml"
'502':
$ref: "../responses/errors/badGateway.yml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: "Bad gateway"
content:
application/vnd.api+json:
schema:
$ref: "../../schemas/apiGatewayError.yml"
examples:
error-bad-request:
$ref: ../../examples/errors/responses/bad-gateway.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
description: Too many requests
content:
application/vnd.api+json:
application/json:
schema:
$ref: "../../schemas/errorResponse.yml"
type: object
properties:
message:
type: string
example: "Your application has exceeded its quota"
scope:
type: string
example: "application"
policy:
type: string
example: "quota"
limit:
type: integer
example: 300
interval:
type: integer
example: 1
timeunit:
type: string
example: "minute"
ratelimiting_expiry_time_ms:
type: integer
example: 1625498765123
message_id:
type: string
example: "rrt-4773181658036170775-c-geu2-321623-73628915-2"
examples:
error-too-many-requests:
$ref: ../../examples/errors/responses/tooManyRequests.json
9 changes: 9 additions & 0 deletions specification/api/components/schemas/apiGatewayError.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description: API gateway error response
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Bad Gateway"
Loading