Skip to content

Commit 9675a58

Browse files
committed
add feature not enabled error
1 parent 4755c33 commit 9675a58

File tree

5 files changed

+27
-0
lines changed

5 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Feature not enabled.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: '../schemas/ErrorResponses.yml#/featureNotEnabled'

specs/advanced-personalization/common/schemas/ErrorCodes.yml

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ unauthorized:
88
description: HTTP status code for an authorization error.
99
enum: [401]
1010

11+
paymentRequired:
12+
type: integer
13+
description: HTTP status code for a payment required error.
14+
enum: [402]
15+
1116
notFound:
1217
type: integer
1318
description: HTTP status code for a not found error.

specs/advanced-personalization/common/schemas/ErrorMessages.yml

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ unauthorized:
1313
description: Details about the response, such as error messages.
1414
enum: [Unauthorized]
1515

16+
featureNotEnabled:
17+
type: string
18+
description: Details about the response, such as error messages.
19+
enum:
20+
- "Predictive profiles are not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/"
21+
- "Realtime Personalization is not allowed for this app. Please contact support to upgrade your plan: https://support.algolia.com/"
22+
1623
genericNotFound:
1724
type: string
1825
description: Details about the response, such as error messages.

specs/advanced-personalization/common/schemas/ErrorResponses.yml

+8
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ internalServerError:
5353
$ref: './ErrorCodes.yml#/internalServerError'
5454
message:
5555
$ref: './ErrorMessages.yml#/internalServerError'
56+
57+
featureNotEnabled:
58+
type: object
59+
properties:
60+
status:
61+
$ref: './ErrorCodes.yml#/paymentRequired'
62+
message:
63+
$ref: './ErrorMessages.yml#/featureNotEnabled'

specs/advanced-personalization/paths/config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,7 @@ put:
9696
$ref: '../common/responses/BadRequest.yml'
9797
'401':
9898
$ref: '../common/responses/Unauthorized.yml'
99+
'402':
100+
$ref: '../common/responses/FeatureNotEnabled.yml'
99101
'500':
100102
$ref: '../common/responses/InternalServerError.yml'

0 commit comments

Comments
 (0)