Control serialization of a Map (order: explicit + alphanumeric) #137
Unanswered
lfvjimisola
asked this question in
Q&A
Replies: 1 comment 1 reply
-
No, there is no way to do that with default annotations (or I guess from user perspective support could be added to consider |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It could be that I can solve this like this, but it's seem like overkill.
data
that I want to be in alphanumeric order (D1, D2) etc.For this I can use
mapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
version
. And I want version to be on top and the rest of the Map shall be in alphanumeric order. I use a Mapresult
with { "version" = "0.0.1", data = { D1 = {..}, D2 = {..} } }.Is it possible to create deterministic serialization where I can control the order (similar to @JsonPropertyOrder but) for Maps so that it's a combination of explicit and alphanumeric. Ideally, something similar to @JsonPropertyOrder because then I could use:
Beta Was this translation helpful? Give feedback.
All reactions