On Fri, Apr 26, 2019 at 8:46 PM Eric Fenderbosch <e...@fender.net> wrote:
>
> Is it possible, using Views or otherwise, to conditionally flatten an 
> attribute?
>
> For example, View #1:
> {
>   "attr1": "somevalue",
>   "attr2": {
>     "id": 123,
>     "foo": "bar"
>   }
> }
>
> and View #2:
> {
>   "attr1": "somevalue",
>   "attr2": "bar"
> }
>
> attr2 should conditionally serialize to a single attribute under View #2, but 
> serialize normally as a full POJO under View #1.

No; the reverse works (although unconditionally) with
`@JsonUnwrapped`, but there is no matching `@JsonWrapped` at this
point. Views do not support any transformations (structural or value
conversions),  just filtering.

-+ 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+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to