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

core: do not use DeserializationFeature.READ_ENUMS_USING_TO_STRING #630

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

bennyz
Copy link
Member

@bennyz bennyz commented Sep 1, 2022

DeserializationFeature.READ_ENUMS_USING_TO_STRING causes jackson to
deserialize enums using their toString implementation, however, this
implementation may have been overridden to returns a value that does not
match Enum#name(), causing deserialization to fail. Because of this it
would make more sense to use the default, which uses Enum#name() as it
is cannot be overridden.

Additionally, the corresponding serialization config
(WRITE_ENUMS_USING_TO_STRING), which will make jackson use different
methods for serialization and deserialization.

Bug-Url: https://bugzilla.redhat.com/2123008

@bennyz bennyz requested a review from ahadas as a code owner September 1, 2022 13:51
@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 8d72e8c to 0f54790 Compare September 1, 2022 14:00
@bennyz
Copy link
Member Author

bennyz commented Sep 4, 2022

/ost

@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 0f54790 to 9dea759 Compare September 4, 2022 06:36
@ahadas ahadas added the storage label Sep 4, 2022
@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 9dea759 to 5fc7d21 Compare September 6, 2022 10:24
@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch 3 times, most recently from c97ecc6 to 1997fd4 Compare September 6, 2022 10:30
@bennyz
Copy link
Member Author

bennyz commented Sep 6, 2022

/ost

Copy link
Member

@ahadas ahadas left a comment

Choose a reason for hiding this comment

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

that's better :)
please change the commit message and description of the PR

@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 1997fd4 to 429b3e6 Compare September 6, 2022 12:17
@bennyz bennyz changed the title core: fix transferClientType deserialization core: do not use DeserializationFeature.READ_ENUMS_USING_TO_STRING Sep 6, 2022
@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 429b3e6 to 9e8828a Compare September 6, 2022 12:17
@bennyz bennyz force-pushed the fix-client-type-paramter-restore branch from 9e8828a to a483226 Compare September 7, 2022 09:04
@ahadas
Copy link
Member

ahadas commented Sep 7, 2022

lgtm (already approved)
@mwperina any objection to get this in?

@mwperina
Copy link
Member

mwperina commented Sep 8, 2022

/ost

DeserializationFeature.READ_ENUMS_USING_TO_STRING causes jackson to
deserialize enums using their toString implementation, however, this
implementation may have been overridden to returns a value that does not
match Enum#name(), causing deserialization to fail. Because of this it
would make more sense to use the default, which uses Enum#name() as it
is less likely to be overridden.

Additionally, the corresponding serialization config
(WRITE_ENUMS_USING_TO_STRING), which will make jackson use different
methods for serialization and deserialization.

Bug-Url: https://bugzilla.redhat.com/2123008
Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@mwperina mwperina force-pushed the fix-client-type-paramter-restore branch from a483226 to ff78ae0 Compare September 8, 2022 07:22
@mwperina
Copy link
Member

mwperina commented Sep 8, 2022

/ost

@mwperina mwperina merged commit 153e96f into oVirt:master Sep 8, 2022
@bennyz bennyz deleted the fix-client-type-paramter-restore branch September 8, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants