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.

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.

gingeekrishna pushed a commit to gingeekrishna/opensearch-java that referenced this pull request Jul 5, 2026
Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
gingeekrishna and others added 2 commits August 16, 2026 21:44
…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>
Signed-off-by: Radhakrishnan Pachyappan <gingeekrishna@gmail.com>
@gingeekrishna
gingeekrishna force-pushed the fix/1965-shardprofile-fetch-array branch from f49bc26 to 3289780 Compare August 16, 2026 16:14

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Submitted the spec fix upstream: opensearch-project/opensearch-api-specification#1197

@gingeekrishna

Copy link
Copy Markdown
Author

Submitted the spec fix upstream: opensearch-project/opensearch-api-specification#1197

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

3 participants