avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Mucha <alfon...@gmail.com>
Subject how to do non-optional field in nested object?
Date Mon, 27 Nov 2017 14:00:46 GMT
Hi,

I have this avro schema:

{
  "name" : "ARecord",
  "type" : "record",
  "namespace" : "A",
  "fields" : [
    {"name": "id", "type": "string" },
    {
      "name": "B",
      "type": ["null", {
        "type": "record",
        "name": "BRecord",
        "fields": [
          {
            "name": "C",
            "type": "string"
          }
        ]
      }]
    }
  ]
}


and following JSON, which validates against it:

{
  "id": "...",
  "B": {

  }
}


I would expect, that C is required. Why it's not? What shall I do to make
it required?

Thanks!
Martin.

Mime
View raw message