Yes, you can declare types as they are encountered.
On Jul 12, 2010, at 12:39 PM, David Rosenstrauch wrote:
> 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