-
-
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
Experimenting with #1467: Support for @JsonUnwrapped in @JsonCreators #4271
base: 2.19
Are you sure you want to change the base?
Changes from all commits
ffbcbce
ff377aa
d01aee2
1ed23f2
16e5f7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -362,7 +362,7 @@ public BeanPropertyMap renameAll(NameTransformer transformer) | |
newProps.add(prop); | ||
continue; | ||
} | ||
newProps.add(_rename(prop, transformer)); | ||
newProps.add(prop.unwrapped(transformer)); | ||
} | ||
// should we try to re-index? Ordering probably changed but caller probably doesn't want changes... | ||
// 26-Feb-2017, tatu: Probably SHOULD handle renaming wrt Aliases? | ||
|
@@ -713,23 +713,12 @@ public String toString() | |
/********************************************************** | ||
*/ | ||
|
||
protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this breaks backward compatibility - add back the old method and deprecate it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the method can call the new unwrap method, but we need to keep the existing method (its implementation can change - as long as it the change retains the existing behaviour) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, readded it! |
||
{ | ||
if (prop == null) { | ||
return prop; | ||
} | ||
String newName = xf.transform(prop.getName()); | ||
prop = prop.withSimpleName(newName); | ||
JsonDeserializer<?> deser = prop.getValueDeserializer(); | ||
if (deser != null) { | ||
@SuppressWarnings("unchecked") | ||
JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>) | ||
deser.unwrappingDeserializer(xf); | ||
if (newDeser != deser) { | ||
prop = prop.withValueDeserializer(newDeser); | ||
} | ||
} | ||
return prop; | ||
/** | ||
* @deprecated since 1.19 in favor of {@link SettableBeanProperty#unwrapped(NameTransformer)} | ||
*/ | ||
@Deprecated | ||
protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf) { | ||
return prop.unwrapped(xf); | ||
} | ||
|
||
protected void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) | ||
|
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.
Can you add
@since 2.18
? likewise with any other new public methods.