Skip to content

Commit 22f49f1

Browse files
Fluf22millotp
andauthored
fix(specs): update time range number types [skip-bc] (#4023)
Co-authored-by: Pierre Millot <[email protected]>
1 parent b798ae7 commit 22f49f1

File tree

5 files changed

+8
-33
lines changed

5 files changed

+8
-33
lines changed

generators/src/main/java/com/algolia/codegen/cts/tests/ParametersWithDataType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ private void handleMap(String paramName, Object param, Map<String, Object> testO
478478
}
479479

480480
private void handlePrimitive(Object param, Map<String, Object> testOutput, IJsonSchemaValidationProperties spec) throws CTSException {
481-
if (spec != null && spec.getIsPrimitiveType()) {
481+
// some int64 are not considered primitive, thanks a lot openapi
482+
if (spec != null && (spec.getIsPrimitiveType() || spec.getIsLong())) {
482483
transferPrimitiveData(spec, testOutput);
483484
} else {
484485
inferDataType(param, null, testOutput);

specs/common/schemas/Rule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ timeRange:
1313
properties:
1414
from:
1515
type: integer
16+
format: int64
1617
description: When the rule should start to be active, in Unix epoch time.
1718
until:
1819
type: integer
20+
format: int64
1921
description: When the rule should stop to be active, in Unix epoch time.
2022
required:
2123
- from
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
taskID:
2-
type: integer
3-
format: int64
4-
example: 1514562690001
5-
description: |
6-
Unique identifier of a task.
7-
8-
A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
9-
10-
updatedAt:
11-
type: string
12-
example: 2023-07-04T12:49:15Z
13-
description: Date and time when the object was updated, in RFC 3339 format.
14-
151
recommendUpdatedAtResponse:
162
type: object
173
description: Response, taskID, and update timestamp.
@@ -21,6 +7,6 @@ recommendUpdatedAtResponse:
217
- updatedAt
228
properties:
239
taskID:
24-
$ref: '#/taskID'
10+
$ref: '../../../common/responses/common.yml#/taskID'
2511
updatedAt:
26-
$ref: '#/updatedAt'
12+
$ref: '../../../common/responses/common.yml#/updatedAt'

specs/recommend/common/schemas/RecommendRule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RecommendRule:
99
description: Rule metadata.
1010
properties:
1111
lastUpdate:
12-
$ref: '../responses/common.yml#/updatedAt'
12+
$ref: '../../../common/responses/common.yml#/updatedAt'
1313
objectID:
1414
$ref: '../../../common/parameters.yml#/ruleID'
1515
condition:

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rule:
3030
type: array
3131
description: Time periods when the rule is active.
3232
items:
33-
$ref: '#/timeRange'
33+
$ref: '../../../../common/schemas/Rule.yml#/timeRange'
3434
required:
3535
- objectID
3636

@@ -289,20 +289,6 @@ automaticFacetFilter:
289289
required:
290290
- facet
291291

292-
timeRange:
293-
type: object
294-
additionalProperties: false
295-
properties:
296-
from:
297-
type: integer
298-
description: When the rule should start to be active, in Unix epoch time.
299-
until:
300-
type: integer
301-
description: When the rule should stop to be active, in Unix epoch time.
302-
required:
303-
- from
304-
- until
305-
306292
updatedRuleResponse:
307293
type: object
308294
additionalProperties: false

0 commit comments

Comments
 (0)