-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Prefix and Suffix not sufficient for every use case.
While a very narrow use case consider following example:
class Rectangle {
@JsonUnwrapped(prefix="topLeft")
Point topLeft;
@JsonUnwrapped(prefix="bottomRight")
Point bottomRight;
}
For now this would be serialized as:
{
topLeft.x: 0,
topLeft.y: 0,
bottomRight.x: 2048.
bottomRight.y: 1080
}
From documentation it would seem its not possible to coerce Jackson into serializing it as:
{
left: 0,
top: 0,
right: 2048
bottom: 1080,
}
I am not entirely sure that this is even possible but I suppose something along the lines of:
class Rectangle {
@JsonUnwrapped(
names = {"x","y"},
renames= {"left", "top"}
)
Point topLeft;
@JsonUnwrapped(
names = {"x","y"},
renames= {"right", "bottom"}
)
Point bottomRight;
}
Would cover all thinkable use cases.
AlexCzar, blazejkarmelita, PolonioliM, mpolonioli, edoardonani and 3 more
Metadata
Metadata
Assignees
Labels
No labels