There is no way to represent such content as JsonNode without losing
some of the ordering information, unfortunately, as duplicate keys are
not allowed.
This is indeed a limitation that cannot be overcome with that model.
One thing that you could do is to instead define a POJO with setters
to match "type1" and "type2": setters will get called
in document order and you can retain ordering using whatever data
structure you want.
Or, alternatively, you could possibly sub-class one of `Map`
implementations (or define a completely custom one), override its
`put()` method which should also be
called for properties, in order. Within that method you could do
something different than call "super.put()".
I hope this helps,
-+ Tatu +-
>
>
> --
> You received this message because you are subscribed to the Google Groups "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
jackson-user...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/5b129782-c3c2-4bb3-b9c8-8222d18339c0n%40googlegroups.com.