Skip to content

Commit f413c3f

Browse files
CCM-13554 - APIM Errors not serializing (#300)
* CCM-13554 - APIM Errors not serializing * CCM-13554 - Update 429 response * 502 error from api gateway * revert rate limiting * remove created yml files
1 parent ab52b68 commit f413c3f

File tree

11 files changed

+67
-14
lines changed

11 files changed

+67
-14
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "Bad Gateway"
3+
}
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
{
2-
"errors": [
3-
{
4-
"code": "NOTIFY_QUOTA",
5-
"detail": "You have made too many requests. Please try again later.",
6-
"id": "rrt-1931948104716186917-c-geu2-10664-3111479-3.0",
7-
"links": {
8-
"about": "https://digital.nhs.uk/developer/api-catalogue/nhs-notify-supplier"
9-
},
10-
"status": "429",
11-
"title": "Too many requests"
12-
}
13-
]
2+
"interval": 1,
3+
"limit": 1,
4+
"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.",
5+
"message_id": "rrt-4773181658036170775-c-geu2-321623-73628915-2",
6+
"policy": "quota",
7+
"ratelimiting_expiry_time_ms": 1765372560000,
8+
"scope": "application",
9+
"timeunit": "minute"
1410
}

specification/api/components/endpoints/createMI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ responses:
1515
$ref: "../responses/errors/tooManyRequests.yml"
1616
'500':
1717
$ref: "../responses/errors/serverError.yml"
18+
'502':
19+
$ref: "../responses/errors/badGateway.yml"

specification/api/components/endpoints/getDataId.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ responses:
1313
$ref: "../responses/errors/tooManyRequests.yml"
1414
"500":
1515
$ref: "../responses/errors/serverError.yml"
16+
"502":
17+
$ref: "../responses/errors/badGateway.yml"

specification/api/components/endpoints/getLetterStatus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ responses:
1111
$ref: "../responses/errors/tooManyRequests.yml"
1212
"500":
1313
$ref: "../responses/errors/serverError.yml"
14+
"502":
15+
$ref: "../responses/errors/badGateway.yml"
1416
tags:
1517
- letter

specification/api/components/endpoints/listLetters.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ responses:
1818
$ref: "../responses/errors/tooManyRequests.yml"
1919
'500':
2020
$ref: "../responses/errors/serverError.yml"
21+
'502':
22+
$ref: "../responses/errors/badGateway.yml"

specification/api/components/endpoints/patchLetter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ responses:
1515
$ref: "../responses/errors/tooManyRequests.yml"
1616
"500":
1717
$ref: "../responses/errors/serverError.yml"
18+
"502":
19+
$ref: "../responses/errors/badGateway.yml"
1820
tags:
1921
- letter

specification/api/components/endpoints/postLetters.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ responses:
1515
$ref: "../responses/errors/tooManyRequests.yml"
1616
'500':
1717
$ref: "../responses/errors/serverError.yml"
18+
'502':
19+
$ref: "../responses/errors/badGateway.yml"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
description: "Bad gateway"
2+
content:
3+
application/vnd.api+json:
4+
schema:
5+
$ref: "../../schemas/apiGatewayError.yml"
6+
examples:
7+
error-bad-request:
8+
$ref: ../../examples/errors/responses/bad-gateway.json
Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
description: Too many requests
22
content:
3-
application/vnd.api+json:
3+
application/json:
44
schema:
5-
$ref: "../../schemas/errorResponse.yml"
5+
type: object
6+
properties:
7+
message:
8+
type: string
9+
example: "Your application has exceeded its quota"
10+
scope:
11+
type: string
12+
example: "application"
13+
policy:
14+
type: string
15+
example: "quota"
16+
limit:
17+
type: integer
18+
example: 300
19+
interval:
20+
type: integer
21+
example: 1
22+
timeunit:
23+
type: string
24+
example: "minute"
25+
ratelimiting_expiry_time_ms:
26+
type: integer
27+
example: 1625498765123
28+
message_id:
29+
type: string
30+
example: "rrt-4773181658036170775-c-geu2-321623-73628915-2"
631
examples:
732
error-too-many-requests:
833
$ref: ../../examples/errors/responses/tooManyRequests.json

0 commit comments

Comments
 (0)