You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Raquel Benito Barbero (Jira)" <ji...@apache.org> on 2020/11/05 18:15:00 UTC

[jira] [Created] (NIFI-7985) ValidateRecord does not validate the type enum

Raquel Benito Barbero created NIFI-7985:
-------------------------------------------

             Summary: ValidateRecord does not validate the type enum
                 Key: NIFI-7985
                 URL: https://issues.apache.org/jira/browse/NIFI-7985
             Project: Apache NiFi
          Issue Type: Bug
    Affects Versions: 1.12.1, 1.9.2
            Reporter: Raquel Benito Barbero
         Attachments: testIssueEnums.xml

ValidateRecord processor does not validate correctly the enum data type against a flow file with JSON content. If an AVRO schema is placed with an enum it does not check the content of the field, just the type. 

Example: 

We have  json like this: 

{"test":"test"}

 

Then whe have the next AVRO schema: 

{
"name": "MyClass",
"type": "record",
"namespace": "com.test",
"fields": [
{
"name": "test",
"type": {
"type": "enum",
"name": "status",
"symbols": [
"OK",
"Failure"
]
}
}
]
}

 

Eventhough the word "test" is not included in one of the options for this field (that should be an enum type)The flowfile passes as valid. It only checks if it is the same type than the options inside the enum (In this case String) 

I made a simple template in case you want to test it. 

 

I've tested it in versions 1.9.2 and 1.12.1 and the same behavior is observed. 

 

 

 



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