Skip to content

Commit

Permalink
fix(specs): update time range number types [skip-bc] (#4023)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
Fluf22 and millotp authored Oct 24, 2024
1 parent b798ae7 commit 22f49f1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ private void handleMap(String paramName, Object param, Map<String, Object> testO
}

private void handlePrimitive(Object param, Map<String, Object> testOutput, IJsonSchemaValidationProperties spec) throws CTSException {
if (spec != null && spec.getIsPrimitiveType()) {
// some int64 are not considered primitive, thanks a lot openapi
if (spec != null && (spec.getIsPrimitiveType() || spec.getIsLong())) {
transferPrimitiveData(spec, testOutput);
} else {
inferDataType(param, null, testOutput);
Expand Down
2 changes: 2 additions & 0 deletions specs/common/schemas/Rule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ timeRange:
properties:
from:
type: integer
format: int64
description: When the rule should start to be active, in Unix epoch time.
until:
type: integer
format: int64
description: When the rule should stop to be active, in Unix epoch time.
required:
- from
Expand Down
18 changes: 2 additions & 16 deletions specs/recommend/common/responses/common.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
taskID:
type: integer
format: int64
example: 1514562690001
description: |
Unique identifier of a task.
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`.
updatedAt:
type: string
example: 2023-07-04T12:49:15Z
description: Date and time when the object was updated, in RFC 3339 format.

recommendUpdatedAtResponse:
type: object
description: Response, taskID, and update timestamp.
Expand All @@ -21,6 +7,6 @@ recommendUpdatedAtResponse:
- updatedAt
properties:
taskID:
$ref: '#/taskID'
$ref: '../../../common/responses/common.yml#/taskID'
updatedAt:
$ref: '#/updatedAt'
$ref: '../../../common/responses/common.yml#/updatedAt'
2 changes: 1 addition & 1 deletion specs/recommend/common/schemas/RecommendRule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RecommendRule:
description: Rule metadata.
properties:
lastUpdate:
$ref: '../responses/common.yml#/updatedAt'
$ref: '../../../common/responses/common.yml#/updatedAt'
objectID:
$ref: '../../../common/parameters.yml#/ruleID'
condition:
Expand Down
16 changes: 1 addition & 15 deletions specs/search/paths/rules/common/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rule:
type: array
description: Time periods when the rule is active.
items:
$ref: '#/timeRange'
$ref: '../../../../common/schemas/Rule.yml#/timeRange'
required:
- objectID

Expand Down Expand Up @@ -289,20 +289,6 @@ automaticFacetFilter:
required:
- facet

timeRange:
type: object
additionalProperties: false
properties:
from:
type: integer
description: When the rule should start to be active, in Unix epoch time.
until:
type: integer
description: When the rule should stop to be active, in Unix epoch time.
required:
- from
- until

updatedRuleResponse:
type: object
additionalProperties: false
Expand Down

0 comments on commit 22f49f1

Please sign in to comment.