From 9bcd99e713c97022b5499b7eba97b70c05596972 Mon Sep 17 00:00:00 2001 From: Radha Krishnan P Date: Mon, 17 Aug 2026 09:02:29 +0530 Subject: [PATCH 1/2] fix(_common): make ShardFailure.shard optional OpenSearch may omit the shard field in ShardFailure responses for certain failure types (e.g. index-level failures where no specific shard is implicated). The field was incorrectly listed as required, causing MissingRequiredPropertyException in the Java client when deserializing responses from opensearch-project/opensearch-java#1799. Remove shard from the required list; it remains defined as an integer property so it is still serialized/deserialized when present. Signed-off-by: Radha Krishnan P --- spec/schemas/_common.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 66188c8e0..96a1291b9 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -337,7 +337,6 @@ components: required: - primary - reason - - shard ShardSearchFailure: type: object description: Represents a failure to search on a specific shard. Used in search responses. From 646c39dc7f30631e08f2be5d3f77f0e4ed3144b8 Mon Sep 17 00:00:00 2001 From: Radha Krishnan P Date: Mon, 24 Aug 2026 13:30:43 +0530 Subject: [PATCH 2/2] fix(_common): rename ShardFailure fields to match server response ReplicationResponse.ShardInfo.Failure on the server always writes the shard field, so making it optional just masked a MissingRequiredPropertyException instead of fixing it. The real issue is a name mismatch: the server writes _index, _shard, _node (underscore-prefixed) while this schema defined index, shard, node without the prefix, so clients looked up the wrong key and got null/missing errors. Rename the properties to _index, _shard, _node to match what the server actually serializes, and restore shard (as _shard) as required since the server always includes it. Addresses review comment from @iprithv on #1194. Signed-off-by: Radha Krishnan P --- spec/schemas/_common.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 96a1291b9..72db31161 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -322,19 +322,20 @@ components: ShardFailure: type: object properties: - index: + _index: $ref: '#/components/schemas/IndexName' - node: + _node: type: string reason: $ref: '#/components/schemas/ErrorCause' - shard: + _shard: type: integer status: type: string primary: type: boolean required: + - _shard - primary - reason ShardSearchFailure: