Skip to content

Commit e3c6b84

Browse files
authored
fix(specs): remove cross-specs references (#3412)
1 parent f643292 commit e3c6b84

File tree

11 files changed

+109
-112
lines changed

11 files changed

+109
-112
lines changed

specs/common/responses/common.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ updatedAtResponse:
5959
$ref: '#/taskID'
6060
updatedAt:
6161
$ref: '#/updatedAt'
62+
63+
taskStatus:
64+
type: string
65+
enum: [published, notPublished]
66+
description: Task status, `published` if the task is completed, `notPublished` otherwise.

specs/common/schemas/Hit.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
matchedGeoLocation:
2+
type: object
3+
properties:
4+
lat:
5+
type: number
6+
format: double
7+
description: Latitude of the matched location.
8+
lng:
9+
type: number
10+
format: double
11+
description: Longitude of the matched location.
12+
distance:
13+
type: integer
14+
description: Distance between the matched location and the search location (in meters).
15+
16+
personalization:
17+
type: object
18+
properties:
19+
filtersScore:
20+
type: integer
21+
description: The score of the filters.
22+
rankingScore:
23+
type: integer
24+
description: The score of the ranking.
25+
score:
26+
type: integer
27+
description: The score of the event.
28+
29+
rankingInfo:
30+
type: object
31+
description: Object with detailed information about the record's ranking.
32+
additionalProperties: false
33+
properties:
34+
filters:
35+
type: integer
36+
minimum: 0
37+
description: Whether a filter matched the query.
38+
firstMatchedWord:
39+
type: integer
40+
minimum: 0
41+
description: Position of the first matched word in the best matching attribute of the record.
42+
geoDistance:
43+
type: integer
44+
minimum: 0
45+
description: Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
46+
geoPrecision:
47+
type: integer
48+
minimum: 1
49+
description: Precision used when computing the geo distance, in meters.
50+
matchedGeoLocation:
51+
$ref: '#/matchedGeoLocation'
52+
personalization:
53+
$ref: '#/personalization'
54+
nbExactWords:
55+
type: integer
56+
minimum: 0
57+
description: Number of exactly matched words.
58+
nbTypos:
59+
type: integer
60+
minimum: 0
61+
description: Number of typos encountered when matching the record.
62+
promoted:
63+
type: boolean
64+
description: Whether the record was promoted by a rule.
65+
proximityDistance:
66+
type: integer
67+
minimum: 0
68+
description: Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
69+
userScore:
70+
type: integer
71+
description: Overall ranking of the record, expressed as a single integer. This attribute is internal.
72+
words:
73+
type: integer
74+
minimum: 1
75+
description: Number of matched words.
76+
promotedByReRanking:
77+
type: boolean
78+
description: Whether the record is re-ranked.
79+
required:
80+
- nbTypos
81+
- firstMatchedWord
82+
- geoDistance
83+
- nbExactWords
84+
- userScore
85+
86+
distinctSeqID:
87+
type: integer

specs/common/schemas/Rule.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
context:
2+
type: string
3+
pattern: '[A-Za-z0-9_-]+'
4+
description: |
5+
An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter.
6+
For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`.
7+
A rule context must only contain alphanumeric characters.
8+
example: mobile

specs/recommend/common/schemas/RecommendRule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Condition:
3333
filters:
3434
$ref: '../../../common/schemas/SearchParams.yml#/filters'
3535
context:
36-
$ref: '../../../search/paths/rules/common/schemas.yml#/context'
36+
$ref: '../../../common/schemas/Rule.yml#/context'
3737

3838
Consequence:
3939
type: object

specs/recommend/common/schemas/RecommendationsResponse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ recommendHit:
3636
_snippetResult:
3737
$ref: '../../../common/schemas/SnippetResult.yml#/snippetResultMap'
3838
_rankingInfo:
39-
$ref: '../../../search/common/schemas/Hit.yml#/rankingInfo'
39+
$ref: '../../../common/schemas/Hit.yml#/rankingInfo'
4040
_distinctSeqID:
41-
$ref: '../../../search/common/schemas/Hit.yml#/_distinctSeqID'
41+
$ref: '../../../common/schemas/Hit.yml#/distinctSeqID'
4242
_score:
4343
$ref: '#/recommendScore'
4444

specs/recommend/paths/getRecommendStatus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ get:
3131
additionalProperties: false
3232
properties:
3333
status:
34-
$ref: '../../search/common/enums.yml#/taskStatus'
34+
$ref: '../../common/responses/common.yml#/taskStatus'
3535
required:
3636
- status
3737
'400':

specs/search/common/enums.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,3 @@ logType:
3232
type: string
3333
enum: [all, query, build, error]
3434
default: all
35-
36-
taskStatus:
37-
type: string
38-
enum: [published, notPublished]
39-
description: Task status, `published` if the task is completed, `notPublished` otherwise.

specs/search/common/schemas/Hit.yml

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -16,95 +16,6 @@ hit:
1616
_snippetResult:
1717
$ref: '../../../common/schemas/SnippetResult.yml#/snippetResultMap'
1818
_rankingInfo:
19-
$ref: '#/rankingInfo'
19+
$ref: '../../../common/schemas/Hit.yml#/rankingInfo'
2020
_distinctSeqID:
21-
$ref: '#/_distinctSeqID'
22-
23-
# Props
24-
_distinctSeqID:
25-
type: integer
26-
27-
rankingInfo:
28-
type: object
29-
description: Object with detailed information about the record's ranking.
30-
additionalProperties: false
31-
properties:
32-
filters:
33-
type: integer
34-
minimum: 0
35-
description: Whether a filter matched the query.
36-
firstMatchedWord:
37-
type: integer
38-
minimum: 0
39-
description: Position of the first matched word in the best matching attribute of the record.
40-
geoDistance:
41-
type: integer
42-
minimum: 0
43-
description: Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters).
44-
geoPrecision:
45-
type: integer
46-
minimum: 1
47-
description: Precision used when computing the geo distance, in meters.
48-
matchedGeoLocation:
49-
$ref: '#/matchedGeoLocation'
50-
personalization:
51-
$ref: '#/personalization'
52-
nbExactWords:
53-
type: integer
54-
minimum: 0
55-
description: Number of exactly matched words.
56-
nbTypos:
57-
type: integer
58-
minimum: 0
59-
description: Number of typos encountered when matching the record.
60-
promoted:
61-
type: boolean
62-
description: Whether the record was promoted by a rule.
63-
proximityDistance:
64-
type: integer
65-
minimum: 0
66-
description: Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0.
67-
userScore:
68-
type: integer
69-
description: Overall ranking of the record, expressed as a single integer. This attribute is internal.
70-
words:
71-
type: integer
72-
minimum: 1
73-
description: Number of matched words.
74-
promotedByReRanking:
75-
type: boolean
76-
description: Whether the record is re-ranked.
77-
required:
78-
- nbTypos
79-
- firstMatchedWord
80-
- geoDistance
81-
- nbExactWords
82-
- userScore
83-
84-
matchedGeoLocation:
85-
type: object
86-
properties:
87-
lat:
88-
type: number
89-
format: double
90-
description: Latitude of the matched location.
91-
lng:
92-
type: number
93-
format: double
94-
description: Longitude of the matched location.
95-
distance:
96-
type: integer
97-
description: Distance between the matched location and the search location (in meters).
98-
99-
personalization:
100-
type: object
101-
properties:
102-
filtersScore:
103-
type: integer
104-
description: The score of the filters.
105-
rankingScore:
106-
type: integer
107-
description: The score of the ranking.
108-
score:
109-
type: integer
110-
description: The score of the event.
21+
$ref: '../../../common/schemas/Hit.yml#/distinctSeqID'

specs/search/paths/advanced/getAppTask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ get:
2727
additionalProperties: false
2828
properties:
2929
status:
30-
$ref: '../../common/enums.yml#/taskStatus'
30+
$ref: '../../../common/responses/common.yml#/taskStatus'
3131
required:
3232
- status
3333
'400':

specs/search/paths/advanced/getTask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ get:
3434
additionalProperties: false
3535
properties:
3636
status:
37-
$ref: '../../common/enums.yml#/taskStatus'
37+
$ref: '../../../common/responses/common.yml#/taskStatus'
3838
required:
3939
- status
4040
'400':

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ condition:
5454
description: Whether the pattern should match plurals, synonyms, and typos.
5555
default: false
5656
context:
57-
$ref: '#/context'
57+
$ref: '../../../../common/schemas/Rule.yml#/context'
5858
filters:
5959
type: string
6060
description: |
@@ -77,15 +77,6 @@ anchoring:
7777
Empty queries are only allowed as pattern with `anchoring: is`.
7878
enum: [is, startsWith, endsWith, contains]
7979

80-
context:
81-
type: string
82-
pattern: '[A-Za-z0-9_-]+'
83-
description: |
84-
An additional restriction that only triggers the rule, when the search has the same value as `ruleContexts` parameter.
85-
For example, if `context: mobile`, the rule is only triggered when the search request has a matching `ruleContexts: mobile`.
86-
A rule context must only contain alphanumeric characters.
87-
example: mobile
88-
8980
consequence:
9081
type: object
9182
description: |

0 commit comments

Comments
 (0)