Skip to content

Fix ShardProfile.fetch typed as single FetchProfile instead of List<FetchProfile>#2040

Open
gingeekrishna wants to merge 2 commits into
opensearch-project:mainfrom
gingeekrishna:fix/1965-shardprofile-fetch-array
Open

Fix ShardProfile.fetch typed as single FetchProfile instead of List<FetchProfile>#2040
gingeekrishna wants to merge 2 commits into
opensearch-project:mainfrom
gingeekrishna:fix/1965-shardprofile-fetch-array

Conversation

@gingeekrishna

Copy link
Copy Markdown

Fixes #1965

OpenSearch returns fetch as a JSON array in profile responses, but the spec defined it as a single FetchProfile object. This caused:

UnexpectedJsonEventException: Unexpected JSON event 'START_ARRAY' instead of '[START_OBJECT, KEY_NAME]'

Fix: Change the spec to type: array / items: $ref: FetchProfile and update the generated ShardProfile.java to use List<FetchProfile> with array serialization and arrayDeserializer, matching the pattern already used by aggregations and searches in the same class.

…etchProfile>

OpenSearch returns fetch as a JSON array in profile responses but the
spec defined it as a single FetchProfile object. This caused:
  UnexpectedJsonEventException: Unexpected JSON event 'START_ARRAY'
  instead of '[START_OBJECT, KEY_NAME]'

Change the spec to type: array / items: FetchProfile and update the
generated ShardProfile.java to use List<FetchProfile> with array
serialization and arrayDeserializer, matching the pattern already
used by aggregations and searches in the same class.

Fixes opensearch-project#1965

Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
Copilot AI review requested due to automatic review settings July 5, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Client is unable to deserialize search response with profile API enabled

2 participants