On Mon, Sep 16, 2019 at 11:42 AM Wojciech Olech <[email protected]> wrote:
>
> Hi,
>
>
> I'm looking for some easy convinient way using annotations for flat object 
> serialization to neseted JSON, see example below:
>
>
> class Abcde {
>
>    String a;
>
>    String b;
>
>    String c;
>
>    String d;
>
>    String e;
>
> }
>
>
> to
>
>
> {
>
>   a:"a",
>
>   b:"b",
>
>   cde: {
>
>      c:"c",
>
>      de: {
>
>         d:"d",
>
>         e:"e"
>
>      }
>
>   }
>
> }
>
>
> I know that I can do it by implementing custom serializer, but somehow I hope 
> that there is quick annotation for that, like: 
> @JsonProperty("nested1/nested2/name")

At this point a custom serializer and deserializer would be needed.

There is an issue to add `@JsonWrapped`, which (if implemented) would
allow change in nesting (as an opposite of existing `@JsonUnwrapped`),
but that has not been implemented nor has there been any active work
to make that happen.

-+ 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jackson-user/CAL4a10hDpzVjY2tuwJrwrXWbRtp-myogQexT5_NzEyNZX_VP2g%40mail.gmail.com.

Reply via email to