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

Fixes deserialization of enums when using booleans instead of strings #482

Merged

Conversation

patschl
Copy link
Contributor

@patschl patschl commented May 16, 2023

Description

Allows for boolean values for enums which support those, eg. DynamicMapping and Refresh.

Issues Resolved

Fixes #256

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: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
@dblock
Copy link
Member

dblock commented May 16, 2023

Before I merge, what tests would fail if DeserializerSupportingBooleans was actually implemented as part of Deserializer? And what would be the user impact?

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
@patschl
Copy link
Contributor Author

patschl commented May 16, 2023

I just tried it and actually no test fails, it's just an unexpected behaviour to implicitly support boolean deserialization with the Enum Deserializer.

If you'd like to I could move the new deserialization logic to the existing Deserializer.

@dblock
Copy link
Member

dblock commented May 16, 2023

I just tried it and actually no test fails, it's just an unexpected behaviour to implicitly support boolean deserialization with the Enum Deserializer.

If you'd like to I could move the new deserialization logic to the existing Deserializer.

Yes yes!

@dblock
Copy link
Member

dblock commented May 16, 2023

Also please update documentation/README.

@patschl patschl force-pushed the fix_enum_boolean_deserialization branch from d79afc5 to b372d24 Compare May 17, 2023 11:20
@patschl
Copy link
Contributor Author

patschl commented May 17, 2023

I made the recommended changes and updated the CHANGELOG.md along with the Javadoc.
Which documentation/README are you referring to?

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
@patschl patschl force-pushed the fix_enum_boolean_deserialization branch from b372d24 to 125b78f Compare May 17, 2023 12:08
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.

LGTM! No need to change anything in README.

@reta reta merged commit 5af5674 into opensearch-project:main May 18, 2023
@reta reta added the backport 2.x Backport to 2.x branch label May 18, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 18, 2023
…#482)

* Fixes deserialization of enums when using booleans instead of strings

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>

* Fixes CHANGELOG.md

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>

* Fixes checkstyle failure

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>

* Include boolean support in existing JsonEnum.Deserializer

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>

---------

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
(cherry picked from commit 5af5674)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@patschl patschl deleted the fix_enum_boolean_deserialization branch May 18, 2023 21:37
dblock pushed a commit that referenced this pull request May 21, 2023
…#482) (#488)

* Fixes deserialization of enums when using booleans instead of strings



* Fixes CHANGELOG.md



* Fixes checkstyle failure



* Include boolean support in existing JsonEnum.Deserializer



---------


(cherry picked from commit 5af5674)

Signed-off-by: Patrick Schlindwein <patrick.schlindwein@bolindalabs.com>
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>
@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.

[BUG] Serialize DynamicMapping boolean type
3 participants