Skip to content

Commit c0a5654

Browse files
committed
refact(specs): rename files + small updates
1 parent 8fde562 commit c0a5654

File tree

8 files changed

+249
-3
lines changed

8 files changed

+249
-3
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
deleteCompositionAction:
2+
type: object
3+
description: Operation arguments when deleting.
4+
additionalProperties: false
5+
properties:
6+
objectID:
7+
$ref: '../../../common/parameters.yml#/objectID'
8+
required:
9+
- objectID
10+
11+
batchCompositionAction:
12+
oneOf:
13+
- $ref: './listCompositionsResponse.yml#/composition'
14+
- $ref: '#/deleteCompositionAction'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
composition:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
objectID:
6+
$ref: '../../../common/parameters.yml#/objectID'
7+
name:
8+
type: string
9+
description: Composition name.
10+
example: 'my lovely crafted composition'
11+
description:
12+
type: string
13+
description: Composition description.
14+
example: 'my lovely crafted composition that is used for X purpose'
15+
behavior:
16+
$ref: './CompositionBehavior.yml#/compositionBehavior'
17+
required:
18+
- objectID
19+
- behavior
20+
- name
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
compositionBehavior:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
injection:
6+
title: injection
7+
type: object
8+
additionalProperties: false
9+
properties:
10+
main:
11+
title: main
12+
type: object
13+
additionalProperties: false
14+
properties:
15+
source:
16+
title: compositionSource
17+
type: object
18+
additionalProperties: false
19+
properties:
20+
search:
21+
title: compositionSourceSearch
22+
type: object
23+
additionalProperties: false
24+
properties:
25+
index:
26+
type: string
27+
description: Composition Main Index name.
28+
example: Products
29+
params:
30+
$ref: './SearchParams.yml#/mainInjectionQueryParameters'
31+
required:
32+
- index
33+
required:
34+
- search
35+
required:
36+
- source
37+
injectedItems:
38+
type: array
39+
description: list of injected items of the current Composition.
40+
minItems: 0
41+
maxItems: 2
42+
items:
43+
$ref: '#/injectedItem'
44+
required:
45+
- main
46+
required:
47+
- injection
48+
49+
injectedItem:
50+
type: object
51+
additionalProperties: false
52+
properties:
53+
key:
54+
type: string
55+
description: injected Item unique identifier.
56+
source:
57+
title: injectedItemSource
58+
type: object
59+
additionalProperties: false
60+
properties:
61+
search:
62+
title: injectedItemSourceSearch
63+
type: object
64+
additionalProperties: false
65+
properties:
66+
index:
67+
type: string
68+
description: Composition Main Index name.
69+
example: Products
70+
params:
71+
$ref: './SearchParams.yml#/injectedItemsQueryParameters'
72+
required:
73+
- index
74+
required:
75+
- search
76+
position:
77+
type: integer
78+
minimum: 0
79+
maximum: 19
80+
length:
81+
type: integer
82+
minimum: 0
83+
maximum: 20
84+
required:
85+
- key
86+
- source
87+
- position
88+
- length
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
compositionRule:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
objectID:
6+
$ref: '../../../common/parameters.yml#/objectID'
7+
conditions:
8+
type: array
9+
minItems: 0
10+
maxItems: 25
11+
description: Conditions that trigger a composition rule.
12+
items:
13+
$ref: '#/condition'
14+
consequence:
15+
title: compositionRuleConsequence
16+
type: object
17+
description: Effect of the rule.
18+
additionalProperties: false
19+
properties:
20+
behavior:
21+
$ref: './compositionBehavior.yml#/compositionBehavior'
22+
required:
23+
- behavior
24+
description:
25+
type: string
26+
description: Description of the rule's purpose to help you distinguish between different rules.
27+
example: Display a promotional banner
28+
enabled:
29+
type: boolean
30+
default: true
31+
description: Whether the rule is active.
32+
validity:
33+
type: array
34+
description: Time periods when the rule is active.
35+
items:
36+
$ref: '../../../common/schemas/Rule.yml#/timeRange'
37+
required:
38+
- objectID
39+
- conditions
40+
- consequence
41+
42+
condition:
43+
type: object
44+
additionalProperties: false
45+
properties:
46+
pattern:
47+
type: string
48+
description: |
49+
Query pattern that triggers the rule.
50+
51+
You can use either a literal string, or a special pattern `{facet:ATTRIBUTE}`, where `ATTRIBUTE` is a facet name.
52+
The rule is triggered if the query matches the literal string or a value of the specified facet.
53+
For example, with `pattern: {facet:genre}`, the rule is triggered when users search for a genre, such as "comedy".
54+
example: '{facet:genre}'
55+
anchoring:
56+
$ref: '#/anchoring'
57+
context:
58+
$ref: '../../../common/schemas/Rule.yml#/context'
59+
filters:
60+
type: string
61+
description: |
62+
Filters that trigger the rule.
63+
64+
You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected.
65+
You can use `filters` on its own or combine it with the `pattern` parameter.
66+
example: 'genre:comedy'
67+
68+
anchoring:
69+
type: string
70+
description: |
71+
Which part of the search query the pattern should match:
72+
73+
- `startsWith`. The pattern must match the beginning of the query.
74+
- `endsWith`. The pattern must match the end of the query.
75+
- `is`. The pattern must match the query exactly.
76+
- `contains`. The pattern must match anywhere in the query.
77+
78+
Empty queries are only allowed as patterns with `anchoring: is`.
79+
enum: [is, startsWith, endsWith, contains]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
listCompositionsResponse:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
items:
6+
type: array
7+
description: All compositions in your Algolia application.
8+
items:
9+
$ref: './Composition.yml#/composition'
10+
nbPages:
11+
type: integer
12+
description: Number of pages.
13+
example: 100
14+
page:
15+
type: integer
16+
description: Current page.
17+
example: 0
18+
hitsPerPage:
19+
type: integer
20+
description: Number of items per page.
21+
example: 20
22+
nbHits:
23+
type: integer
24+
description: Number of items.
25+
example: 200
26+
required:
27+
- hitsPerPage
28+
- items
29+
- nbHits
30+
- nbPages
31+
- page
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
deleteCompositionRuleAction:
2+
type: object
3+
description: Operation arguments when deleting.
4+
additionalProperties: false
5+
properties:
6+
objectID:
7+
$ref: '../../../common/parameters.yml#/objectID'
8+
required:
9+
- objectID
10+
11+
rulesBatchCompositionAction:
12+
oneOf:
13+
- $ref: './compositionRule.yml#/compositionRule'
14+
- $ref: '#/deleteCompositionRuleAction'

specs/composition-full/common/schemas/SearchParams.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ mainInjectionQueryParameters:
240240
type: array
241241
items:
242242
type: string
243-
example: [author, title, conten, content]
243+
example: [author, title, content]
244244
description: |
245245
Attributes to highlight.
246246
@@ -705,7 +705,7 @@ injectedItemsQueryParameters:
705705
type: array
706706
items:
707707
type: string
708-
example: [author, title, conten, content]
708+
example: [author, title, content]
709709
description: |
710710
Attributes to highlight.
711711

specs/composition-full/paths/manage_compositions/listCompositions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ get:
1717
content:
1818
application/json:
1919
schema:
20-
$ref: '../../common/schemas/listCompositionsResponse.yml#/listCompositionsResponse'
20+
$ref: '../../common/schemas/listCompositionsResponse.yml#/ListCompositionsResponse'
2121
'400':
2222
$ref: '../../../common/responses/BadRequest.yml'
2323
'402':

0 commit comments

Comments
 (0)