[
https://issues.apache.org/jira/browse/NIFI-2310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15384211#comment-15384211
]
ASF GitHub Bot commented on NIFI-2310:
--------------------------------------
Github user YolandaMDavis commented on the issue:
https://github.com/apache/nifi/pull/674
Here is the error that occurred before this fix <img width="1397"
alt="shiftrparseerror"
src="https://cloud.githubusercontent.com/assets/1371858/16953212/3b7b93e0-4d9a-11e6-879d-080c9ec9ed89.png">
To test use the following specification for Shiftr ensure that spec is
valid:
`{
"\\@context": {
"name": "&1.Name",
"ingredient": "&1.Inputs",
"yield": "\\@context.Makes",
"*": "&1.&"
},
"name": "Name",
"ingredient": "Inputs",
"yield": "Makes",
"*": "&"
}
`
Also the below test input can be used in the Advance (from
http://jolt-demo.appspot.com/#json-ld-escaping)
`{
"comment" : "pulled from http://json-ld.org/playground/ example recipe.
Also, Mojitos are good.",
"@context": {
"name": "http://rdf.data-vocabulary.org/#name",
"ingredient": "http://rdf.data-vocabulary.org/#ingredients",
"yield": "http://rdf.data-vocabulary.org/#yield",
"instructions": "http://rdf.data-vocabulary.org/#instructions",
"step": {
"@id": "http://rdf.data-vocabulary.org/#step",
"@type": "xsd:integer"
},
"description": "http://rdf.data-vocabulary.org/#description",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"name": "Mojito",
"ingredient": [
"12 fresh mint leaves",
"1/2 lime, juiced with pulp",
"1 tablespoons white sugar",
"1 cup ice cubes",
"2 fluid ounces white rum",
"1/2 cup club soda"
],
"yield": "1 cocktail",
"instructions": [
{
"step": 1,
"description": "Crush lime juice, mint and sugar together in glass."
},
{
"step": 2,
"description": "Fill glass to top with ice cubes."
},
{
"step": 3,
"description": "Pour white rum over ice."
},
{
"step": 4,
"description": "Fill the rest of glass with club soda, stir."
},
{
"step": 5,
"description": "Garnish with a lime wedge."
}
]
}`
> Shiftr Transform in JoltTransformJSON Processor Does Not Support Escaping
> Special Characters
> --------------------------------------------------------------------------------------------
>
> Key: NIFI-2310
> URL: https://issues.apache.org/jira/browse/NIFI-2310
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Yolanda M. Davis
> Assignee: Yolanda M. Davis
> Fix For: 1.0.0
>
>
> The following jolt spec failed to pass the validation check in
> JoltTransformJSON:
> {
> "\\@context": {
> "name": "&1.Name",
> "ingredient": "&1.Inputs",
> "yield": "\\@context.Makes",
> "*": "&1.&"
> },
> "name": "Name",
> "ingredient": "Inputs",
> "yield": "Makes",
> "*": "&"
> }
> The reason is the double backslash to escape '@' which should be supported to
> identify literal characters.
> Upgrading to Jolt version 0.0.21 should resolve this problem since it was
> fixed in that release.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)