nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Dyer <jdy...@gmail.com>
Subject Re: Nesting and AttributesToJSON
Date Mon, 01 Feb 2016 23:14:18 GMT
Jeroen,

AttributesToJSON currently does not support nested JSON and instead maps
everything to a flat JSON object. The problem is a lot of NiFi attributes
used the "something.else" syntax and it would be hard to determine what
delimiter should indicate a nested JSON element.

Right now you are going to get the result ...

{

 "card.style" = url

 "card.url" = http://mysite.com
}

Knowing about the "." limitation do you have ideas about how you would like
to see this nesting occur?

Thanks,
Jeremy Dyer


On Mon, Feb 1, 2016 at 5:57 PM, Jeroen Jacobs <jeroen.jacobs@headincloud.be>
wrote:

>
> Hi,
>
>
> A very simple question: How do I need to arrange my attributes to get the
> following JSON file:
>
>
> {
>
>     "card": {
>
>         "style" : "url"
>
>         "url": "http://mysite.com"
>
>     }
>
> }
>
>
> I tried it by creating two attributes:
>
>
> card.style = url
>
> card.url = http://mysite.com
>
>
> But no matter how I try to use AttributesToJSON, I don't get the desired
> result. I tried to pass "card" and "card.*" as arguments to Attributes
> List, but they don't have the desired result.
>
>
> And I don't like to repeat myself, but the documentation doesn't mention
> it either...
>
>
> Kind regards,
>
> Jeroen
>

Mime
View raw message