Skip to content

Pass full RestResponse to user from Extension#114

Merged
dbwiddis merged 1 commit intoopensearch-project:mainfrom
dbwiddis:restResponse
Sep 2, 2022
Merged

Pass full RestResponse to user from Extension#114
dbwiddis merged 1 commit intoopensearch-project:mainfrom
dbwiddis:restResponse

Conversation

@dbwiddis
Copy link
Copy Markdown
Member

Companion PR: opensearch-project/OpenSearch#4356

Description

In the initial SDK implementation, I simply returned a String from the Extension's REST handler to the user.

This PR updates the (SDK API) return value to a RestResponse to match what a user would have received from OpenSearch itself or a plugin, including the HTTP Status Code, and the ability to return formats other than text.

As a bonus, I figured out how to test the input and output streams in the Request/Response classes and have improved those tests as well.

Issues Resolved

Fixes #112

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis merged commit 4dc1895 into opensearch-project:main Sep 2, 2022
@dbwiddis dbwiddis deleted the restResponse branch September 2, 2022 03:03
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
Signed-off-by: Daniel Widdis <widdis@gmail.com>

Signed-off-by: Daniel Widdis <widdis@gmail.com>
caokyhieu pushed a commit to caokyhieu/opensearch-sdk-java that referenced this pull request Aug 15, 2025
Signed-off-by: Daniel Widdis <widdis@gmail.com>

Signed-off-by: Daniel Widdis <widdis@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.

[FEATURE] Return HTTP Status from Extensions

3 participants