-
Notifications
You must be signed in to change notification settings - Fork 191
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
TermvectorsResponse fix for optionals. #642
TermvectorsResponse fix for optionals. #642
Conversation
Signed-off-by: pieper <[email protected]>
Signed-off-by: pieper <[email protected]>
@@ -157,8 +157,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { | |||
generator.writeKey("took"); | |||
generator.write(this.took); | |||
|
|||
generator.writeKey("_version"); | |||
generator.write(this.version); | |||
if (null != this.version) { |
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.
Tabs vs. spaces looks suspicious here. Also surprised spotless didn't catch it, mind checking please?
@@ -157,8 +157,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { | |||
generator.writeKey("took"); | |||
generator.write(this.took); | |||
|
|||
generator.writeKey("_version"); | |||
generator.write(this.version); | |||
if (null != this.version) { |
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.
Is this optional? Maybe add a test?
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.
You have right. According to the server sources https://github.com/opensearch-project/OpenSearch/blob/7dc6683838951e1a211c6ff634d9eea93e2be3c2/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java#L205 _version is still delivered.
Signed-off-by: pieper <[email protected]>
Signed-off-by: pieper <[email protected]>
@MikePieperSer Can you please fix the merge conflicts? Thank you! |
…_optionals_main Signed-off-by: pieper <[email protected]>
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.
Super nit please.
CHANGELOG.md
Outdated
@@ -30,6 +30,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- Fix version and build ([#254](https://github.com/opensearch-project/opensearch-java/pull/254)) | |||
- Fix PutMappingRequest by removing unsupported fields ([#597](https://github.com/opensearch-project/opensearch-java/pull/597)) | |||
- Fix parsing of GetFieldMappingResponse ([#641](https://github.com/opensearch-project/opensearch-java/pull/641)) | |||
- [BUG] Fix TermvectorsResponse for optional fields. ([#642](https://github.com/opensearch-project/opensearch-java/pull/642)) |
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.
Let's make this look like the other lines. Say Fix ...
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.
Done.
Signed-off-by: pieper <[email protected]>
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.
You will hate me ;)
CHANGELOG.md
Outdated
@@ -30,6 +30,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |||
- Fix version and build ([#254](https://github.com/opensearch-project/opensearch-java/pull/254)) | |||
- Fix PutMappingRequest by removing unsupported fields ([#597](https://github.com/opensearch-project/opensearch-java/pull/597)) | |||
- Fix parsing of GetFieldMappingResponse ([#641](https://github.com/opensearch-project/opensearch-java/pull/641)) | |||
- Fix TermvectorsResponse for optional fields. ([#642](https://github.com/opensearch-project/opensearch-java/pull/642)) |
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.
Remove the period please
Signed-off-by: pieper <[email protected]>
* TermvectorsResponse fix for optionals. Signed-off-by: pieper <[email protected]> * Add Changelog. Signed-off-by: pieper <[email protected]> * Tabs vs. spaces fix. Signed-off-by: pieper <[email protected]> * Version is not optional. Signed-off-by: pieper <[email protected]> * Changelog fix. Signed-off-by: pieper <[email protected]> * Period removed. Signed-off-by: pieper <[email protected]> --------- Signed-off-by: pieper <[email protected]> Signed-off-by: Vacha Shah <[email protected]>
Not sure why the backport workflow did not run, I will look into it. Created a manual backport PR #658 for now. |
* TermvectorsResponse fix for optionals. * Add Changelog. * Tabs vs. spaces fix. * Version is not optional. * Changelog fix. * Period removed. --------- Signed-off-by: pieper <[email protected]> Signed-off-by: Vacha Shah <[email protected]> Co-authored-by: MikePieperSer <[email protected]>
Description
This makes optional fields in TermvectorsResponse optional.
Issues Resolved
Closes [#639 ]
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.