nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Mucha <alfon...@gmail.com>
Subject ValidateRecord1.4.0 vs ConvertJsonToAvro1.4.0 regarding required field in nested object
Date Wed, 06 Dec 2017 09:59:45 GMT
Hi,

I have JSON like:

{
  "a": {
    "b": "1"
  }
}

and corresponding avro schema (written for the sake of this e-mail, need
not to be 100% accurate)

{
  "name": "aRecord",
  "type": "record",
  "namespace": "a",
  "fields": [
    {
      "name": "a",
      "type": {
        "name": "bRecord",
        "type":"record",
        "fields": [
          { "name": "b", "type": "string"}
        ]
      }
    }

  ]
}

In ConvertJsonToAvro processor, json missing field "b":

{"a":{}}

will be rejected, while in ValidateRecord it will be accepted as valid
(which is not valid according to schema). Is there anything I can do about
it? Is it bug?

thanks,
Martin.

Mime
View raw message