-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make PropertyNamingStrategy
not affect Enums
#4414
Conversation
There are a few issues here; I don't think this would work. First question is compatibility: do we know when did Second: determination for renaming should be based on type being introspected; PR does checks on per-property basis but it should really be based on type of POJO that |
private boolean _shouldRename(POJOPropertyBuilder prop) { | ||
// [databind#4409]: Need to skip renaming for Enums, unless OBJECT format | ||
if (getType().isEnumType() && Objects.equals(prop.getPrimaryType(), getType())) { | ||
if (prop.isObjectFormatShape()) { |
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.
This is in wrong place: it would check for annotation of a property of Enum type referring to another type and being annotated as Shape.OBJECT
-- that would not cover cases where Enum
class is annotated or -- if supported, not sure it is -- property of another (almost certainly non-Enum) type pointing Enum type and having Shape override.
How about this: a more extensive change to block any application of global |
You mean like test I wrote in PR against 2.15 in my personal repo? I can't think of other cases at the moment, but will figure out. Btw, should we keep the work against 2.16 then? |
Implemented 20b6e54 as per comment #4403 /cc @cowtowncoder |
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.
LGTM, will try to get merged later tonight.
possible fix for #4409