Skip to content

Commit 784e40a

Browse files
e-krebsshortcuts
andauthored
feat(specs): improve Composition Client searchResponse specs (matches SearchClient more closely for IS) (#4300)
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
1 parent b90600e commit 784e40a

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

specs/composition/common/schemas/SearchResponse.yml

+29-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,34 @@ searchResults:
1313
description: Search results.
1414
items:
1515
$ref: '#/searchResultsItem'
16+
required:
17+
- results
1618

1719
searchResultsItem:
1820
allOf:
1921
- $ref: '../../../common/schemas/SearchResponse.yml#/baseSearchResponse'
20-
- $ref: '../../../common/schemas/SearchResponse.yml#/SearchPagination'
22+
- $ref: '#/SearchPagination'
2123
- $ref: '#/searchHits'
2224
- $ref: '#/resultsCompositionsResponse'
2325

26+
SearchPagination:
27+
type: object
28+
additionalProperties: false
29+
properties:
30+
page:
31+
$ref: '../../../common/schemas/SearchParams.yml#/page'
32+
nbHits:
33+
$ref: '../../../common/schemas/SearchResponse.yml#/nbHits'
34+
nbPages:
35+
$ref: '../../../common/schemas/SearchResponse.yml#/nbPages'
36+
hitsPerPage:
37+
$ref: '../../../common/schemas/IndexSettings.yml#/hitsPerPage'
38+
required:
39+
- page
40+
- nbHits
41+
- nbPages
42+
- hitsPerPage
43+
2444
searchHits:
2545
type: object
2646
additionalProperties: true
@@ -33,8 +53,16 @@ searchHits:
3353
Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
3454
items:
3555
$ref: 'Hit.yml#/hit'
56+
query:
57+
$ref: '../../../common/schemas/SearchParams.yml#/query'
58+
params:
59+
type: string
60+
description: URL-encoded string of all search parameters.
61+
example: query=a&hitsPerPage=20
3662
required:
3763
- hits
64+
- query
65+
- params
3866

3967
resultsCompositionsResponse:
4068
type: object

0 commit comments

Comments
 (0)