[ https://issues.apache.org/jira/browse/NIFI-7981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17226721#comment-17226721 ]
Pierre Villard commented on NIFI-7981: -------------------------------------- I've not been able to reproduce this issue using the main branch of NiFi. If it happened on 1.12.1, then a recent commit fixed the issue and this will be solved in 1.13.0 when we release it. Template to test: [^record_enum.xml] Going to open a pull request with a unit test so that we cover enums in our test suite anyway. > ConvertRecord cannot handle open enum in Avro > --------------------------------------------- > > Key: NIFI-7981 > URL: https://issues.apache.org/jira/browse/NIFI-7981 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 1.12.1 > Reporter: Christophe Monnet > Priority: Minor > Attachments: record_enum.xml > > > This avro schema is using the open enum pattern: > {code:json} > { > "namespace": "acme", > "name": "openEnum", > "type": "record", > "fields": [{ > "name": "personType", > "type": ["null", { > "type": "enum", > "name": "personType_enum", > "symbols": [ > "DRIVER", > "TECHNICIAN" > ] > }, "string"], > "default": null > } > ] > } > {code} > The *personType* can be either null, an enum, or any string. This brings > forward-compatibility. > Using ConvertRecord with > {"personType":"DRIVER"} > as a payload, it works. > But with > {"personType":"DUDE"} > it fails with {{java.lang.NullPointerException: null of acme.personType_enum > of union in field personType of acme.openEnum}} -- This message was sent by Atlassian Jira (v8.3.4#803005)