Skip to content
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

Conversation

MikePieperSer
Copy link
Contributor

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.

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) {
Copy link
Member

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) {
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VachaShah
Copy link
Collaborator

@MikePieperSer Can you please fix the merge conflicts? Thank you!

Copy link
Member

@dblock dblock left a 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))
Copy link
Member

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 ...

Copy link
Contributor Author

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]>
dblock
dblock previously approved these changes Oct 5, 2023
Copy link
Member

@dblock dblock left a 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))
Copy link
Member

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]>
@VachaShah VachaShah added the backport 2.x Backport to 2.x branch label Oct 9, 2023
@VachaShah VachaShah merged commit 1b8b788 into opensearch-project:main Oct 9, 2023
31 checks passed
VachaShah pushed a commit to VachaShah/opensearch-java that referenced this pull request Oct 9, 2023
* 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]>
@VachaShah
Copy link
Collaborator

Not sure why the backport workflow did not run, I will look into it. Created a manual backport PR #658 for now.

dblock pushed a commit that referenced this pull request Oct 9, 2023
* 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]>
@BrendonFaleiro BrendonFaleiro mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants