Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When the JSON Record Reader is used, if the schema provides a CHOICE of two different RECORD types for a sub-record, then the sub-record's schema ends up being an empty schema. This results in RecordPath's not properly evaluating. For example, with the schema below:
{ "name": "top", "namespace": "nifi", "type": "record", "fields": [ { "name": "id", "type": "string" }, { "name": "child", "type": [{ "name": "first", "type": "record", "fields": [{ "name": "name", "type": "string" }] }, { "name": "second", "type": "record", "fields": [{ "name": "id", "type": "string" }] }] } ] }
If I then have the following JSON:
{ "id": "1234", "child": { "id": "4321" } }
The result is that the record returned has the correct schema. However, if I then call record.getValue("child") I am returned a Record object that has no schema.
This results in the RecordPath "/child/id" returning a null value.
Attachments
Issue Links
- links to