Skip to content

Return consumed params and content from extensions#187

Merged
dbwiddis merged 7 commits intoopensearch-project:mainfrom
dbwiddis:response
Oct 12, 2022
Merged

Return consumed params and content from extensions#187
dbwiddis merged 7 commits intoopensearch-project:mainfrom
dbwiddis:response

Conversation

@dbwiddis
Copy link
Copy Markdown
Member

@dbwiddis dbwiddis commented Oct 12, 2022

Companion PR: opensearch-project/OpenSearch#4705

This is a resubmit of PR #169 which was previously merged but lost in a force push.
image

Description

Moves the ExtensionRestResponse class from the SDK to o.o.extensions.rest.

  • Updates the class to store the consumed parameters and content as fields
  • Updates the ExtensionRestRequestHandler to copy the new fields
  • To demo content, added POST and DELETE methods to the Hello World sample and updated openapi spec
  • Updated tests for the new methods
  • Fixed a few bugs I found along the way

Issues Resolved

Fixes #165

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>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis requested a review from a team October 12, 2022 01:13
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #187 (d0a00d0) into main (6eab1a5) will decrease coverage by 2.05%.
The diff coverage is 65.62%.

@@             Coverage Diff              @@
##               main     #187      +/-   ##
============================================
- Coverage     69.00%   66.94%   -2.06%     
- Complexity      100      103       +3     
============================================
  Files            25       24       -1     
  Lines           442      475      +33     
  Branches         13       25      +12     
============================================
+ Hits            305      318      +13     
- Misses          129      141      +12     
- Partials          8       16       +8     
Impacted Files Coverage Δ
...ch/sdk/sample/helloworld/rest/RestHelloAction.java 70.96% <61.70%> (-29.04%) ⬇️
...rch/sdk/handlers/ExtensionsRestRequestHandler.java 47.36% <66.66%> (+4.51%) ⬆️
...main/java/org/opensearch/sdk/ExtensionsRunner.java 70.83% <75.00%> (ø)
...nsearch/sdk/handlers/OpensearchRequestHandler.java 66.66% <100.00%> (+6.66%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dbwiddis dbwiddis merged commit 28ad2fb into opensearch-project:main Oct 12, 2022
@dbwiddis dbwiddis deleted the response branch October 12, 2022 01:27
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
…t#187)

* Remove duplicate copies of registries in handlers

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Move ExtensionRestResponse to OpenSearch

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add a POST request to parse content

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add a DELETE request corresponding to the POST

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add consumed params and content to Extension Responses

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Update tests and OpenAPI spec

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
…t#187)

* Remove duplicate copies of registries in handlers

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Move ExtensionRestResponse to OpenSearch

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add a POST request to parse content

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add a DELETE request corresponding to the POST

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Add consumed params and content to Extension Responses

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Update tests and OpenAPI spec

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] Move ExtensionRestResponse class to same package as ExtensionRestRequest

3 participants