Skip to content

Commit

Permalink
Add additionalProperties to ErrorCause and fix creation_date type for…
Browse files Browse the repository at this point in the history
… list_dangling_indices

Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia committed Aug 2, 2024
1 parent b67104c commit 6bffec2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `retry` to `tester` to support asynchronous tasks ([453](https://github.com/opensearch-project/opensearch-api-specification/pull/453))
- Added passing OPENSEARCH_JAVA_OPTS into the docker container used for tests ([#454](https://github.com/opensearch-project/opensearch-api-specification/pull/454))
- Added a warning on mulitple paths being tested in the same file ([#452](https://github.com/opensearch-project/opensearch-api-specification/pull/452))
- Added metadata additionalProperties to `ErrorCause` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))
- Added `creation_time` field to `DanglingIndex` ([#462](https://github.com/opensearch-project/opensearch-api-specification/pull/462))

### Changed

Expand Down
4 changes: 4 additions & 0 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ components:
UnitMillis:
description: Time unit for milliseconds
type: number
format: int64
DurationLarge:
description: |-
A date histogram interval. Similar to `Duration` with additional units: `w` (week), `M` (month), `q` (quarter) and
Expand Down Expand Up @@ -315,6 +316,9 @@ components:
$ref: '#/components/schemas/ErrorCause'
required:
- type
additionalProperties:
title: metadata
description: Additional details about the error
DurationValueUnitNanos:
allOf:
- $ref: '#/components/schemas/UnitNanos'
Expand Down
2 changes: 2 additions & 0 deletions spec/schemas/dangling_indices.list_dangling_indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ components:
type: string
index_uuid:
type: string
creation_date:
$ref: '_common.yaml#/components/schemas/DateTime'
creation_date_millis:
$ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis'
node_ids:
Expand Down
2 changes: 1 addition & 1 deletion tools/src/_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function determine_possible_schema_types (doc: OpenAPIV3.Document, schema
if (schema?.anyOf !== undefined) return collect_all(schema.anyOf)
if (schema?.oneOf !== undefined) return collect_all(schema.oneOf)

if (schema == null || Object.keys(schema).filter(k => k !== 'description').length == 0) return SCHEMA_OBJECT_TYPES
if (schema == null || Object.keys(schema).filter(k => k !== 'description' && k !== 'title').length == 0) return SCHEMA_OBJECT_TYPES

throw new Error(`Unable to determine possible types of schema: ${to_json(schema)}`)
}
Expand Down

0 comments on commit 6bffec2

Please sign in to comment.