-
-
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
Allow using @JsonPropertyOrder
with any-property (@JsonAnyGetter
)
#4396
base: 2.18
Are you sure you want to change the base?
Changes from all commits
6b13aeb
85422ed
8fe3a1f
7a067d9
8f3a301
d62c154
0cfc627
daf659d
7e97e1f
9262fde
e6dfd8d
6ce6510
6a0e2fd
9b7a14a
941b320
b3947a3
46af6cb
871bf62
9f86204
0c5671d
9a04fa6
6f6db89
9411e9c
47da548
f850530
d615b2c
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 |
---|---|---|
|
@@ -218,6 +218,8 @@ public void serializeAsField(Object pojo, JsonGenerator jgen, | |
writer.serializeAsField(pojo, jgen, provider); | ||
} else if (!jgen.canOmitFields()) { // since 2.3 | ||
writer.serializeAsOmittedField(pojo, jgen, provider); | ||
} else if (writer instanceof AnyGetterWriter) { | ||
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. WIP : Contemplating on how should we optimize this check... 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. I tried referring to other writer/serializers and it turns out |
||
((AnyGetterWriter) writer).getAndFilter(pojo, jgen, provider, this); | ||
} | ||
} | ||
|
||
|
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.
Is this actually safe? Doesn't it copy settings of "parent"?
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.
It was intended actually. Copying seemed safer than holding reference to original BeanPropertyWriterpropert propert that is soon to be a any-getter.
I referenced same pattern in
VirtualBeanPropertyWriter
,UnwrappingBeanPropertyWriter
, like below.Do you think there would be side effect?