[
https://issues.apache.org/jira/browse/NIFI-12404?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Stieglitz updated NIFI-12404:
------------------------------------
Description:
Utilizing the Jackson library to parse YAML allowed for reuse of much of the
code used by the JsonTreeReader. A side effect though is Jackson does not
support the resolution of Yaml aliases. An example would be the following Yaml
where the ship-to value references the anchor defined in the bill-to section.
{code:java}
bill-to: &id001
street: |
123 Tornado Alley
Suite 16
city: East Centerville
state: KS
ship-to: *id001
{code}
The above Yaml is transformed to the following JSON when using ConvertRecord
configured with the YamlTreeReader and the JsonRecordSetWriter:
{code:java}
[ {
"bill-to" : {
"street" : "123 Tornado Alley\nSuite 16\n",
"city" : "East Centerville",
"state" : "KS"
},
"ship-to" : "id001"
} ]{code}
Note how the "ship-to" does not contain the same value as "bill-to" but rather
a string with the name of the alias.
This is a known bug in Jackson as seen
[here|https://github.com/FasterXML/jackson-dataformats-text/issues/98]
The aim of this ticket is to add to the YamlTreeReader documentation the fact
that Yaml aliases are not resolved.
was:
Utilizing the Jackson library to parse YAML allowed for reuse of much of the
code used by the JsonTreeReader. A side effect though is Jackson does not
support the resolution of Yaml aliases. An example would be the following Yaml
where the ship-to value references the anchor defined in the bill-to section.
{code:java}
bill-to: &id001
street: |
123 Tornado Alley
Suite 16
city: East Centerville
state: KS
ship-to: *id001
{code}
The above Yaml is transformed to the following JSON when using ConvertRecord
configured with the YamlTreeReader and the JsonRecordSetWriter looks like
{code:java}
[ {
"bill-to" : {
"street" : "123 Tornado Alley\nSuite 16\n",
"city" : "East Centerville",
"state" : "KS"
},
"ship-to" : "id001"
} ]{code}
Note how the "ship-to" does not contain the same value as "bill-to" but rather
a string with the name of the alias.
This is a known bug in Jackson as seen
[here|https://github.com/FasterXML/jackson-dataformats-text/issues/98]
The aim of this ticket is to add to the YamlTreeReader documentation the fact
that Yaml aliases are not resolved.
> YamlTreeReader does not support Yaml aliases
> --------------------------------------------
>
> Key: NIFI-12404
> URL: https://issues.apache.org/jira/browse/NIFI-12404
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Daniel Stieglitz
> Assignee: Daniel Stieglitz
> Priority: Minor
>
> Utilizing the Jackson library to parse YAML allowed for reuse of much of the
> code used by the JsonTreeReader. A side effect though is Jackson does not
> support the resolution of Yaml aliases. An example would be the following
> Yaml where the ship-to value references the anchor defined in the bill-to
> section.
>
> {code:java}
> bill-to: &id001
> street: |
> 123 Tornado Alley
> Suite 16
> city: East Centerville
> state: KS
> ship-to: *id001
> {code}
>
> The above Yaml is transformed to the following JSON when using ConvertRecord
> configured with the YamlTreeReader and the JsonRecordSetWriter:
> {code:java}
> [ {
> "bill-to" : {
> "street" : "123 Tornado Alley\nSuite 16\n",
> "city" : "East Centerville",
> "state" : "KS"
> },
> "ship-to" : "id001"
> } ]{code}
>
> Note how the "ship-to" does not contain the same value as "bill-to" but
> rather a string with the name of the alias.
> This is a known bug in Jackson as seen
> [here|https://github.com/FasterXML/jackson-dataformats-text/issues/98]
> The aim of this ticket is to add to the YamlTreeReader documentation the fact
> that Yaml aliases are not resolved.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)