You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Eric Secules (Jira)" <ji...@apache.org> on 2020/07/14 20:19:00 UTC

[jira] [Updated] (NIFI-7636) Validate Record Prints Array Paths in Confusing Way

     [ https://issues.apache.org/jira/browse/NIFI-7636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Secules updated NIFI-7636:
-------------------------------
    Description: 
When there is a avro Validation Error in an element of a JSON array the array index is placed before the array's name in the path. For example if the input JSON was this:
{code:java}
{
  "myArray": [
    {
      "myValue": null
    }
  ]
}
{code}
 and "myValue" was required

 the validation error would be:

 
{code:java}
{
  "fieldName" : "[0]/myArray/myValue",
  "inputValue" : null,
  "explanation" : "Field is required",
  "type" : "MISSING_FIELD"
}
{code}
It would make more sense if the array index was after the array field name like so. Placing the array index before the array doesn't make any sense to me.
{code:java}
{ 
  "fieldName" : "/myArray/[0]/myValue",
  "inputValue" : null,
  "explanation" : "Field is required",
  "type" : "MISSING_FIELD"
}

{code}
or if the field name was made using JSONPath syntax like:
{code:java}
{ 
  "fieldName" : "$.myArray[0].myValue",
  "inputValue" : null,
  "explanation" : "Field is required",
  "type" : "MISSING_FIELD"
} 
{code}
 

  was:
When there is a avro Validation Error in an element of a JSON array the array index is placed before the array's name in the path. For example if the input JSON was this:


{code:java}
{
  "myArray": [
    {
      "myValue": null
    }
  ]
}
{code}
 and "myValue" was required

 the validation error would be:

 
{code:java}
{
  "fieldName" : "[0]/myArray/myValue",
  "inputValue" : null,
  "explanation" : "Field is required",
  "type" : "MISSING_FIELD"
}
{code}

It would make more sense if the array index was after the array field name like so. Placing the array index before the array doesn't make any sense to me.
{code:java}
{ 
  "fieldName" : "/myArray/[0]/myValue",
  "inputValue" : null,
  "explanation" : "Field is required",
  "type" : "MISSING_FIELD"
}

{code}
or if the field name was made using JSONPath syntax like $.myArray[0].myValue.

 


> Validate Record Prints Array Paths in Confusing Way
> ---------------------------------------------------
>
>                 Key: NIFI-7636
>                 URL: https://issues.apache.org/jira/browse/NIFI-7636
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.11.4
>            Reporter: Eric Secules
>            Priority: Major
>
> When there is a avro Validation Error in an element of a JSON array the array index is placed before the array's name in the path. For example if the input JSON was this:
> {code:java}
> {
>   "myArray": [
>     {
>       "myValue": null
>     }
>   ]
> }
> {code}
>  and "myValue" was required
>  the validation error would be:
>  
> {code:java}
> {
>   "fieldName" : "[0]/myArray/myValue",
>   "inputValue" : null,
>   "explanation" : "Field is required",
>   "type" : "MISSING_FIELD"
> }
> {code}
> It would make more sense if the array index was after the array field name like so. Placing the array index before the array doesn't make any sense to me.
> {code:java}
> { 
>   "fieldName" : "/myArray/[0]/myValue",
>   "inputValue" : null,
>   "explanation" : "Field is required",
>   "type" : "MISSING_FIELD"
> }
> {code}
> or if the field name was made using JSONPath syntax like:
> {code:java}
> { 
>   "fieldName" : "$.myArray[0].myValue",
>   "inputValue" : null,
>   "explanation" : "Field is required",
>   "type" : "MISSING_FIELD"
> } 
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)