From cbc0b084a1c261c71e1041093c58489e098318a5 Mon Sep 17 00:00:00 2001 From: Basile Chapellier Date: Wed, 3 Jul 2024 14:51:27 +0200 Subject: [PATCH] Missing required fields (#365) * Missing required fields Signed-off-by: Bzil * Add changelog Signed-off-by: Bzil * Change test and fix it Signed-off-by: Bzil --------- Signed-off-by: Bzil --- CHANGELOG.md | 1 + spec/schemas/_common.yaml | 4 +- spec/schemas/nodes.info.yaml | 90 +++++++++++++++++++++++++----------- tests/_core/nodes.yaml | 9 ++++ 4 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 tests/_core/nodes.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index ad52074a1..63d8ffb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed `_bulk` spec request and response types ([#355](https://github.com/opensearch-project/opensearch-api-specification/pull/355)) - Fixed `text/plain` response in `/_cat` ([#357](https://github.com/opensearch-project/opensearch-api-specification/pull/357)) - Fixed `/_cat/cluster_manager`, `/_cat/allocation`, `/_cat/shards`, and `/_cat/thread_pool` ([#373](https://github.com/opensearch-project/opensearch-api-specification/pull/373)) +- Fixed optional field in `/_nodes` ([#365](https://github.com/opensearch-project/opensearch-api-specification/pull/365)) ### Security diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 297cd3ecf..713509ee5 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -1106,6 +1106,8 @@ components: $ref: '#/components/schemas/VersionString' licensed: type: boolean + custom_foldername: + type: string opensearch_version: $ref: '#/components/schemas/VersionString' required: @@ -1117,7 +1119,6 @@ components: - java_version - name - version - - licensed NodeStatistics: type: object properties: @@ -1690,6 +1691,7 @@ components: - transform - remote_cluster_client - coordinating_only + - cluster_manager HttpHeaders: type: object additionalProperties: diff --git a/spec/schemas/nodes.info.yaml b/spec/schemas/nodes.info.yaml index 15b3d9d83..f687b4523 100644 --- a/spec/schemas/nodes.info.yaml +++ b/spec/schemas/nodes.info.yaml @@ -21,10 +21,8 @@ components: - aggregations - indices - search_pipelines - - _all ResponseBase: allOf: - - $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' - type: object properties: cluster_name: @@ -33,9 +31,12 @@ components: type: object additionalProperties: $ref: '#/components/schemas/NodeInfo' + _nodes: + $ref: 'nodes._common.yaml#/components/schemas/NodesResponseBase' required: - cluster_name - nodes + - _nodes NodeInfo: type: object properties: @@ -99,9 +100,10 @@ components: type: object additionalProperties: $ref: '#/components/schemas/NodeInfoAggregation' + search_pipelines: + $ref: '#/components/schemas/NodeInfoSearchPipelines' required: - attributes - - build_flavor - build_hash - build_type - host @@ -152,6 +154,8 @@ components: type: string vm_version: $ref: '_common.yaml#/components/schemas/VersionString' + bundled_jdk: + type: boolean using_bundled_jdk: type: boolean using_compressed_ordinary_object_pointers: @@ -172,7 +176,7 @@ components: - vm_name - vm_vendor - vm_version - - using_bundled_jdk + - bundled_jdk - input_arguments NodeInfoJvmMemory: type: object @@ -343,6 +347,8 @@ components: $ref: '#/components/schemas/NodeInfoSearch' ingest: $ref: '#/components/schemas/NodeInfoSettingsIngest' + index: + $ref: '#/components/schemas/NodeInfoSettingsIndex' required: - cluster - node @@ -365,7 +371,6 @@ components: $ref: '#/components/schemas/DeprecationIndexing' required: - name - - election NodeInfoSettingsClusterElection: type: object properties: @@ -388,9 +393,7 @@ components: name: $ref: '_common.yaml#/components/schemas/Name' attr: - type: object - additionalProperties: - type: object + $ref: '#/components/schemas/NodeInfoShardIndexingPressureEnabled' max_local_storage_nodes: type: string required: @@ -414,7 +417,6 @@ components: required: - logs - home - - repo NodeInfoRepositories: type: object properties: @@ -429,13 +431,18 @@ components: type: string required: - allowed_urls + NodeInfoShardIndexingPressureEnabled: + type: object + properties: + shard_indexing_pressure_enabled: + type: string + required: + - shard_indexing_pressure_enabled NodeInfoDiscover: type: object properties: seed_hosts: type: string - required: - - seed_hosts NodeInfoAction: type: object properties: @@ -454,7 +461,7 @@ components: type: object properties: type: - $ref: '#/components/schemas/NodeInfoSettingsHttpType' + type: string type.default: type: string compression: @@ -467,13 +474,6 @@ components: - type: string required: - type - NodeInfoSettingsHttpType: - type: object - properties: - default: - type: string - required: - - default NodeInfoBootstrap: type: object properties: @@ -485,18 +485,11 @@ components: type: object properties: type: - $ref: '#/components/schemas/NodeInfoSettingsTransportType' + type: string type.default: type: string required: - type - NodeInfoSettingsTransportType: - type: object - properties: - default: - type: string - required: - - default NodeInfoSettingsNetwork: type: object properties: @@ -613,6 +606,28 @@ components: type: string required: - enabled + NodeInfoSettingsIndex: + type: object + properties: + store: + $ref: '#/components/schemas/NodeInfoSettingsIndexStore' + NodeInfoSettingsIndexStore: + type: object + properties: + hybrid: + $ref: '#/components/schemas/NodeInfoSettingsIndexHybrid' + NodeInfoSettingsIndexHybrid: + type: object + properties: + mmap: + $ref: '#/components/schemas/NodeInfoSettingsIndexStoreMmap' + NodeInfoSettingsIndexStoreMmap: + type: object + properties: + extensions: + type: array + items: + type: string NodeThreadPoolInfo: type: object properties: @@ -673,3 +688,24 @@ components: type: string required: - types + NodeInfoSearchPipelines: + type: object + properties: + response_processors: + type: array + items: + $ref: '#/components/schemas/NodeInfoIngestProcessor2' + request_processors: + type: array + items: + $ref: '#/components/schemas/NodeInfoIngestProcessor2' + required: + - response_processors + - request_processors + NodeInfoIngestProcessor2: + type: object + properties: + type: + type: string + required: + - type \ No newline at end of file diff --git a/tests/_core/nodes.yaml b/tests/_core/nodes.yaml new file mode 100644 index 000000000..608232cb3 --- /dev/null +++ b/tests/_core/nodes.yaml @@ -0,0 +1,9 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test nodes endpoints. +chapters: + - synopsis: Nodes with a json response. + path: /_nodes + method: GET + response: + status: 200