avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rosenstrauch <dar...@darose.net>
Subject Declaring array item types inline
Date Mon, 12 Jul 2010 19:39:59 GMT
Is it possible to declare array item types inline?  i.e., instead of this:

[
   {
     "type": "record",
     "name": "SubRecord",
     "fields" : [
       {"name": "field1", "type": "int"},
       {"name": "field2", "type": "int"}
     ]
   },
   {
     "type": "record",
     "name": "TestRecord",
     "fields" : [
       {
         "name": "SubRecords",
         "type": {
           "type": "array",
           "items": "SubRecord"
         }
       }
     ]
   }
]

Would it be possible to do something like this:

{
   "type": "record",
   "name": "TestRecord",
   "fields" : [
     {
       "name": "SubRecords",
       "type": {
         "type": "array",
         "items": {
           "type": "record",
           "name": "SubRecord",
           "fields" : [
             {"name": "field1", "type": "int"},
             {"name": "field2", "type": "int"}
           ]
         }
       }
     }
   ]
}

It's quite a bit more clunky to do the former.

Thanks,

DR

Mime
View raw message