Skip to content

Commit fed9be0

Browse files
bengreenbankshortcutsraed667
authored
feat(specs): add user profile computation & amend existing user profile endpoints [PRED-3876] (#4944)
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com> Co-authored-by: Raed <raed.chammam@algolia.com>
1 parent 7791fda commit fed9be0

File tree

7 files changed

+90
-4
lines changed

7 files changed

+90
-4
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description: Accepted.
2+
content:
3+
application/json:
4+
schema:
5+
title: acceptedResponse
6+
type: object
7+
additionalProperties: false
8+
required:
9+
- status
10+
- message
11+
properties:
12+
status:
13+
type: integer
14+
example: 202
15+
description: Status code.
16+
message:
17+
type: string
18+
example: Accepted
19+
description: Response message.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description: Conflict.
2+
content:
3+
application/json:
4+
schema:
5+
title: conflictResponse
6+
type: object
7+
additionalProperties: false
8+
required:
9+
- status
10+
- message
11+
properties:
12+
status:
13+
type: integer
14+
example: 409
15+
description: Status code.
16+
message:
17+
type: string
18+
example: Conflict
19+
description: Response message.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
description: Too Many Requests.
2+
content:
3+
application/json:
4+
schema:
5+
title: tooManyRequestsResponse
6+
type: object
7+
additionalProperties: false
8+
required:
9+
- status
10+
- message
11+
properties:
12+
status:
13+
type: integer
14+
example: 421
15+
description: Status code.
16+
message:
17+
type: string
18+
example: Too Many Requests
19+
description: Response message.

specs/realtime-personalization/common/enums.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ strategy:
22
type: string
33
enum:
44
- session
5+
- historical
56
- hybrid
67
example: 'session'
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
post:
2+
tags:
3+
- users
4+
operationId: computeUser
5+
x-acl:
6+
- recommendation
7+
summary: Compute the user's personalization profile
8+
description: Sends a request to compute the user's personalization profile.
9+
parameters:
10+
- $ref: '../common/parameters.yml#/UserToken'
11+
responses:
12+
'202':
13+
$ref: '../../common/responses/Accepted.yml'
14+
'400':
15+
$ref: '../../common/responses/BadRequest.yml'
16+
'402':
17+
$ref: '../../common/responses/FeatureNotEnabled.yml'
18+
'409':
19+
$ref: '../../common/responses/Conflict.yml'
20+
'421':
21+
$ref: '../../common/responses/TooManyRequests.yml'
22+
'422':
23+
$ref: '../../common/responses/StatusUnprocessableEntity.yml'
24+
'500':
25+
$ref: '../../common/responses/InternalError.yml'

specs/realtime-personalization/paths/getUser.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ get:
1919
$ref: '../../common/responses/BadRequest.yml'
2020
'402':
2121
$ref: '../../common/responses/FeatureNotEnabled.yml'
22-
'403':
23-
$ref: '../../common/responses/MethodNotAllowed.yml'
24-
'404':
25-
$ref: '../../common/responses/IndexNotFound.yml'
22+
'421':
23+
$ref: '../../common/responses/TooManyRequests.yml'
24+
'500':
25+
$ref: '../../common/responses/InternalError.yml'

specs/realtime-personalization/spec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ paths:
4949

5050
/2/realtime/users/{userToken}:
5151
$ref: 'paths/getUser.yml'
52+
53+
/2/realtime/users/{userToken}/compute:
54+
$ref: 'paths/computeUser.yml'

0 commit comments

Comments
 (0)