Skip to content

Commit 7a85822

Browse files
authored
fix(specs): correct type for renderingContent and consequenceParams (#759)
1 parent fd9c9ba commit 7a85822

File tree

6 files changed

+149
-17
lines changed

6 files changed

+149
-17
lines changed

.github/.cache_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.6
1+
0.0.7

.redocly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiDefinitions:
1+
apis:
22
abtesting: specs/abtesting/spec.yml
33
analytics: specs/analytics/spec.yml
44
insights: specs/insights/spec.yml

config/openapitools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
"generators": {
55
"javascript-search": {
66
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/client-search",
7-
"reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions",
7+
"reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions,delete=delete",
88
"additionalProperties": {
99
"packageVersion": "0.6.1"
1010
}
1111
},
1212
"javascript-lite": {
1313
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/algoliasearch/lite",
14-
"reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions",
14+
"reservedWordsMappings": "queryParameters=queryParameters,requestOptions=requestOptions,delete=delete",
1515
"additionalProperties": {
1616
"packageVersion": "0.6.1"
1717
}
1818
},
1919
"javascript-recommend": {
2020
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/recommend",
21-
"reservedWordsMappings": "queryParameters=queryParameters",
21+
"reservedWordsMappings": "queryParameters=queryParameters,delete=delete",
2222
"additionalProperties": {
2323
"packageVersion": "0.6.1"
2424
}

specs/common/schemas/IndexSettings.yml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ indexSettingsAsSearchParams:
268268
description: When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage.
269269
default: false
270270
renderingContent:
271-
type: object
272-
description: Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules.
273-
default: {}
271+
$ref: '#/renderingContent'
274272

275273
maxFacetHits:
276274
type: integer
@@ -356,3 +354,59 @@ removeStopWords:
356354
type: string
357355
- type: boolean
358356
default: false
357+
358+
renderingContent:
359+
description: Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules.
360+
type: object
361+
additionalProperties: false
362+
properties:
363+
facetOrdering:
364+
$ref: '#/facetOrdering'
365+
366+
facetOrdering:
367+
description: Defining how facets should be ordered.
368+
type: object
369+
additionalProperties: false
370+
properties:
371+
facets:
372+
$ref: '#/facets'
373+
values:
374+
$ref: '#/values'
375+
376+
facets:
377+
description: The ordering of facets (widgets).
378+
type: object
379+
additionalProperties: false
380+
properties:
381+
order:
382+
$ref: '#/order'
383+
384+
values:
385+
description: The ordering of facet values, within an individual list.
386+
type: object
387+
additionalProperties:
388+
$ref: '#/value'
389+
390+
value:
391+
type: object
392+
additionalProperties: false
393+
properties:
394+
order:
395+
$ref: '#/order'
396+
sortRemainingBy:
397+
$ref: '#/sortRemainingBy'
398+
399+
order:
400+
description: Pinned order of facet lists.
401+
type: array
402+
items:
403+
type: string
404+
405+
sortRemainingBy:
406+
description: >
407+
How to display the remaining items.
408+
- `count`: facet count (descending).
409+
- `alpha`: alphabetical (ascending).
410+
- `hidden`: show only pinned values.
411+
type: string
412+
enum: [count, alpha, hidden]

specs/search/paths/rules/common/schemas.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,66 @@ params:
114114
additionalProperties: false
115115
properties:
116116
query:
117-
type: string
118-
description: Query string.
117+
$ref: '#/query'
119118
automaticFacetFilters:
119+
$ref: '#/automaticFacetFilters'
120+
automaticOptionalFacetFilters:
121+
$ref: '#/automaticOptionalFacetFilters'
122+
renderingContent:
123+
$ref: '../../../../common/schemas/IndexSettings.yml#/renderingContent'
124+
125+
query:
126+
description: When providing a string, it replaces the entire query string. When providing an object, it describes incremental edits to be made to the query string (but you can't do both).
127+
oneOf:
128+
- $ref: '#/consequenceQuery'
129+
- type: string
130+
131+
consequenceQuery:
132+
type: object
133+
additionalProperties: false
134+
properties:
135+
remove:
136+
description: Words to remove.
120137
type: array
121-
description: Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
122138
items:
123-
$ref: '#/automaticFacetFilter'
124-
automaticOptionalFacetFilters:
125-
type: object
126-
description: Same syntax as automaticFacetFilters, but the engine treats the filters as optional.
139+
type: string
140+
edits:
141+
description: Edits to apply.
142+
type: array
143+
items:
144+
$ref: '#/edit'
145+
146+
edit:
147+
type: object
148+
additionalProperties: false
149+
properties:
150+
type:
151+
$ref: '#/editType'
152+
delete:
153+
description: Text or patterns to remove from the query string.
154+
type: string
155+
insert:
156+
description: Text that should be inserted in place of the removed text inside the query string.
157+
type: string
158+
159+
editType:
160+
description: Type of edit.
161+
type: string
162+
enum: [remove, replace]
163+
164+
automaticFacetFilters:
165+
description: Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
166+
oneOf:
167+
- type: array
127168
items:
128169
$ref: '#/automaticFacetFilter'
170+
- type: array
171+
items:
172+
type: string
173+
174+
automaticOptionalFacetFilters:
175+
description: Same syntax as automaticFacetFilters, but the engine treats the filters as optional.
176+
$ref: '#/automaticFacetFilters'
129177

130178
automaticFacetFilter:
131179
type: object

tests/CTS/methods/requests/search/search.json

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,22 @@
328328
],
329329
"attributeCriteriaComputedByMinProximity": true,
330330
"renderingContent": {
331-
"string": "any"
331+
"facetOrdering": {
332+
"facets": {
333+
"order": [
334+
"a",
335+
"b"
336+
]
337+
},
338+
"values": {
339+
"a": {
340+
"order": [
341+
"b"
342+
],
343+
"sortRemainingBy": "count"
344+
}
345+
}
346+
}
332347
},
333348
"type": "default"
334349
}
@@ -470,7 +485,22 @@
470485
],
471486
"attributeCriteriaComputedByMinProximity": true,
472487
"renderingContent": {
473-
"string": "any"
488+
"facetOrdering": {
489+
"facets": {
490+
"order": [
491+
"a",
492+
"b"
493+
]
494+
},
495+
"values": {
496+
"a": {
497+
"order": [
498+
"b"
499+
],
500+
"sortRemainingBy": "count"
501+
}
502+
}
503+
}
474504
},
475505
"type": "default"
476506
}

0 commit comments

Comments
 (0)