opensearch-project / opensearch-project/opensearch-java

[BUG] ResponseException binary response is parsed as string

Open
#1,156 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

When requesting binary response data:
optionsBuilder.addHeader("Accept", "application/cbor");

Any ResponseException will be read as a string instead of the requested format.
This leads to malformed error messages, such as:
org.opensearch.client.ResponseException: method [POST], host [http://localhost:9200], URI [/index/_search], status line [HTTP/1.1 400 Bad Request] ¿eerror¿jroot_causeŸ¿dtypeqparsing_exceptionfreasonx_unknown query[...]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported binary response request with an application/cbor Accept header and an error response. Trace how ResponseException reads and represents the response, then verify that the requested format is preserved instead of being decoded as a string. Done means malformed error messages no longer occur for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.