-
-
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
Rearranging of props when property-based generator is in use leads to incorrect output #2759
Comments
Just to make sure: so the observed problem is duplication of a property? That would be wrong, yes. Thank you for providing a reproduction. One quick question: which version(s) is this with? 2.11.0 or something else? |
I can reproduce this with 2.11(.0) and 2.12.0-SNAPSHOT. |
I feel it is not just a "duplication", but a sort of "shifting" (try put The described problem can also arise if
|
I accidentally found the similar logic in another class ( |
@oshatrk Ah. Lol. Hmmh. That code looked wrong, wrt reordering but... I'll have to a closer look. Thought I spotted a bug but not necessarily. |
Hmmh. I bet it's not reordering that was wrong but rather that mutability is wrong: Yes. That's very likely it: arrays of properties ends up being shared between original (parent), copy (child), and that's likely where problem comes up. Now I need to figure out how to change Quick and dirty check on forcing copy (after making |
When these annotations:
are used on a link to a parent inside a child, and
id
is not the first field of the parent class,then JSON output is incorrect.
With example code I got this:
Expected this:
Notice that
private Long id;
is not the first field of theHive
class.A possible bug is in
BeanSerializerBase.createContextual()
, near this line:Example:
The text was updated successfully, but these errors were encountered: