Skip to content

Commit 10e08c9

Browse files
kai687shortcuts
andauthored
fix(specs): query suggestions api (#2924)
Co-authored-by: shortcuts <vannicattec@gmail.com>
1 parent 4fd41b0 commit 10e08c9

23 files changed

+312
-295
lines changed

specs/query-suggestions/common/enums.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ LogLevel:
22
title: level
33
type: string
44
description: |
5-
The type of log entry.
5+
Type of log entry.
66
77
- `SKIP`. A query is skipped because it doesn't match the conditions for successful inclusion. For example, when a query doesn't generate enough search results.
88
- `INFO`. An informative log entry.

specs/query-suggestions/common/responses/BadRequest.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ description: Bad Request.
22
content:
33
application/json:
44
schema:
5-
$ref: '../schemas/BaseResponse.yml'
5+
$ref: './BaseResponse.yml'
66
examples:
77
IndexNameRequired:
88
summary: Index name required.
9-
value: {'status': 400, 'message': 'IndexName cannot be empty'}
9+
value:
10+
status: 400
11+
message: IndexName cannot be empty.
1012
SourceIndicesRequired:
1113
summary: Source indices required.
1214
value:
13-
'status': 400
14-
'message': 'Invalid body "sourceIndices needs to contain at least one index".'
15-
15+
status: 400
16+
message: Invalid body "sourceIndices needs to contain at least one index".
17+
1618
SourceIndexNameRequired:
1719
summary: Source index name required.
1820
value:
19-
'status': 400
20-
'message': 'Invalid body "every source index must have an `indexName`".'
21-
21+
status: 400
22+
message: Invalid body "every source index must have an `indexName`".
23+
2224
MinHitsPositive:
2325
summary: MinHits must be positive.
2426
value:
25-
'status': 400
26-
'message': 'Invalid body "every source index `minHits` must be positive".'
27-
27+
status: 400
28+
message: Invalid body "every source index `minHits` must be positive".
29+
2830
MinLettersPositive:
2931
summary: MinLetters must be positive.
3032
value:
31-
'status': 400
32-
'message': 'Invalid body "every source index `minLetters` must be positive".'
33+
status: 400
34+
message: Invalid body "every source index `minLetters` must be positive".

specs/query-suggestions/common/schemas/BaseResponse.yml renamed to specs/query-suggestions/common/responses/BaseResponse.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
type: object
2-
additionalProperties: false
32
properties:
43
status:
54
type: integer

specs/query-suggestions/common/responses/InternalError.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ description: Internal Server Error.
22
content:
33
application/json:
44
schema:
5-
$ref: '../schemas/BaseResponse.yml'
5+
$ref: './BaseResponse.yml'
66
examples:
77
Error:
88
description: This error can happen if you use a non-existing `indexName` as a path parameter when trying to update or delete a Query Suggestions configuration.
9-
value: {'status': 500, 'message': 'Internal Server Error'}
9+
value:
10+
status: 500
11+
message: Internal Server Error

specs/query-suggestions/common/responses/NotFound.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ description: Not Found.
22
content:
33
application/json:
44
schema:
5-
$ref: '../schemas/BaseResponse.yml'
5+
$ref: './BaseResponse.yml'
66
examples:
77
NotFound:
88
summary: Index not found.
9-
value: {'status': 404, 'message': 'Not Found'}
9+
value:
10+
status: 404
11+
message: Not Found
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
QuerySuggestionsConfigurationResponse:
2+
type: object
3+
description: API response for retrieving Query Suggestions configurations.
4+
allOf:
5+
- $ref: '#/AppID'
6+
- $ref: '../schemas/QuerySuggestionsConfiguration.yml#/QuerySuggestionsConfigurationWithIndex'
7+
required:
8+
- appID
9+
- allowSpecialCharacters
10+
- enablePersonalization
11+
- exclude
12+
- languages
13+
- sourceIndices
14+
15+
AppID:
16+
type: object
17+
properties:
18+
appID:
19+
type: string
20+
description: Algolia application ID to which this Query Suggestions configuration belongs.

specs/query-suggestions/common/responses/Unauthorized.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,27 @@ description: Unauthorized
22
content:
33
application/json:
44
schema:
5-
$ref: '../schemas/BaseResponse.yml'
5+
$ref: './BaseResponse.yml'
66
examples:
77
Unauthorized:
88
summary: Wrong region.
99
description: |
10-
Make sure to make your request to the server corresponding to your region.
10+
Make sure to make your request to the server corresponding to your region.
1111
1212
You can check the region for your application in the [Algolia dashboard](https://dashboard.algolia.com/account/infrastructure/analytics).
1313
value:
14-
'status': 401
15-
'message': 'The log processing region does not match'
16-
14+
status: 401
15+
message: The log processing region does not match.
16+
1717
InvalidCredentials:
1818
summary: Invalid credentials.
1919
description: Your application ID or API key is wrong.
20-
value: {'status': 401, 'message': 'Invalid credentials'}
20+
value:
21+
status: 401
22+
message: Invalid credentials
2123
MissingACL:
2224
summary: Key is missing ACL.
2325
description: Your API key is missing the required ACL for this operation.
2426
value:
25-
{'status': 401, 'message': 'The provided API key is missing the \"editSettings\" ACL'}
27+
status: 401
28+
message: The provided API key is missing the \"editSettings\" ACL.

specs/query-suggestions/common/responses/UnprocessableEntity.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ description: Unprocessable Entity.
22
content:
33
application/json:
44
schema:
5-
$ref: '../schemas/BaseResponse.yml'
5+
$ref: './BaseResponse.yml'
66
examples:
77
UnprocessableEntity:
88
summary: Configuration already exists.
9-
value:
10-
'status': 422
11-
'message': 'Configuration already exists for index: test-qs'
9+
value:
10+
status: 422
11+
message: 'Configuration already exists for index: test-qs'

specs/query-suggestions/common/schemas/Facet.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

specs/query-suggestions/common/schemas/Languages.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)