-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix response codes returned by JSON formatting them #2156
Conversation
Signed-off-by: Vamsi Manohar <[email protected]>
Signed-off-by: Vamsi Manohar <[email protected]>
* Create Job API Signed-off-by: Vamsi Manohar <[email protected]> * Refactor to Async Query API Signed-off-by: Vamsi Manohar <[email protected]> --------- Signed-off-by: Vamsi Manohar <[email protected]>
Signed-off-by: Vamsi Manohar <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
.../src/main/java/org/opensearch/sql/datasources/transport/TransportUpdateDataSourceAction.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/sql/datasources/transport/TransportCreateDataSourceAction.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #2156 +/- ##
=========================================
Coverage 96.56% 96.57%
Complexity 4717 4717
=========================================
Files 436 436
Lines 12535 12541 +6
Branches 858 858
=========================================
+ Hits 12105 12111 +6
Misses 420 420
Partials 10 10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
...s/src/main/java/org/opensearch/sql/datasources/transport/CreateUpdateDatasourceResponse.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/planner/physical/datasource/DataSourceTableScan.java
Show resolved
Hide resolved
Assertions.assertEquals( | ||
"Updated DataSource with name test_datasource", updateDataSourceActionResponse.getResult()); | ||
jsonResponseFormatter.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert value should be literal string. it is much readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in: 767a9cb
actionListener.onResponse( | ||
new CreateDataSourceActionResponse( | ||
"Created DataSource with name " + dataSourceMetadata.getName())); | ||
String responseContent = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return string in json format, not schema required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reasoning behind this change was to have a response class and later on, if we have time we can do something like return the DataSourceMetadata that was Updated/Created. Don't think we will have time for that/I don't know what the standard is for SQL repo - but I reverted it back to just a JSON string for now - it should be fine as long as the UI can parse it.
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Derek Ho <[email protected]>
* Glue datasource support (#2055) Signed-off-by: Vamsi Manohar <[email protected]> * Initial commit of new job APIs (#2050) Signed-off-by: Vamsi Manohar <[email protected]> * Create Job API (#2070) * Create Job API Signed-off-by: Vamsi Manohar <[email protected]> * Refactor to Async Query API Signed-off-by: Vamsi Manohar <[email protected]> --------- Signed-off-by: Vamsi Manohar <[email protected]> * Cancel Job API (#2126) Signed-off-by: Vamsi Manohar <[email protected]> * Fix response codes returned Signed-off-by: Derek Ho <[email protected]> * Remove @opensearch datasource, update with new type Signed-off-by: Derek Ho <[email protected]> * Spotless Apply Signed-off-by: Derek Ho <[email protected]> * Fix tests Signed-off-by: Derek Ho <[email protected]> * Revert change back to json string Signed-off-by: Derek Ho <[email protected]> * Update tests to use JSON string literal instead of formatting Signed-off-by: Derek Ho <[email protected]> * Update IT Signed-off-by: Derek Ho <[email protected]> * Fix show datsources IT Signed-off-by: Derek Ho <[email protected]> * Remove files from merge Signed-off-by: Derek Ho <[email protected]> --------- Signed-off-by: Vamsi Manohar <[email protected]> Signed-off-by: Derek Ho <[email protected]> Co-authored-by: Vamsi Manohar <[email protected]> (cherry picked from commit 5ce1bab) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Glue datasource support (#2055) * Initial commit of new job APIs (#2050) * Create Job API (#2070) * Create Job API * Refactor to Async Query API --------- * Cancel Job API (#2126) * Fix response codes returned * Remove @opensearch datasource, update with new type * Spotless Apply * Fix tests * Revert change back to json string * Update tests to use JSON string literal instead of formatting * Update IT * Fix show datsources IT * Remove files from merge --------- (cherry picked from commit 5ce1bab) Signed-off-by: Vamsi Manohar <[email protected]> Signed-off-by: Derek Ho <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Vamsi Manohar <[email protected]>
Description
Fix response returned by POST and PUT. Before, front end could not parse the JSON, so used JSONFormatter to format them.
Issues Resolved
Fix: #2157
Check List
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.