Return-Path: Delivered-To: apmail-avro-user-archive@www.apache.org Received: (qmail 29450 invoked from network); 12 Jul 2010 21:04:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Jul 2010 21:04:38 -0000 Received: (qmail 94965 invoked by uid 500); 12 Jul 2010 21:04:38 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 94879 invoked by uid 500); 12 Jul 2010 21:04:37 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 94871 invoked by uid 99); 12 Jul 2010 21:04:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 21:04:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.97.132.74] (HELO homiemail-a4.g.dreamhost.com) (208.97.132.74) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 21:04:28 +0000 Received: from homiemail-a4.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id 8AE4651C073 for ; Mon, 12 Jul 2010 14:03:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=darose.net; h=message-id:date :from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=darose.net; b= y5PWkZeuobZQou49YmnqKZiWXFuoCkZPtb77OFNbZFMBxm3GLhJ4MXIn+LFRo3Aa grB5vgp7Rh+eJS6zj3whp07lEK0ANx3lkxJDgIUT1K6LzcAztC4rQz2AYOIiSpce mnl+/hEOwhs9VoFcjGGXJkwclUX3WSM1IAZoF5OUbF4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=darose.net; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=darose.net; bh=jhvPaw vFKMLbM+7kaJBDPctGH2w=; b=NOLZMPKY49TIq9eknY8cfBZnk30sTqiHtrujKs QCce55ohuwIVwMQ6XbZ17hlZK8XK0//rHIrO6zJEy/ehl4CfAQmqCQX8EuGS6p6o A8hOYNIgFAJ+Vau6PLjtTSPIrpyg2rCBzO8G6zicQg5fpyfwt0YKUes3F4gVPaJT 5Mvg8= Received: from darsys12 (cpe-66-108-142-190.nyc.res.rr.com [66.108.142.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: darose@darose.net) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTPSA id 7182851C06C for ; Mon, 12 Jul 2010 14:03:37 -0700 (PDT) Received: from [10.1.0.2] by darsys12 with esmtp (Exim 4.72) (envelope-from ) id 1OYQA4-0007iD-2q for user@avro.apache.org; Mon, 12 Jul 2010 17:03:36 -0400 Message-ID: <4C3B8354.4080704@darose.net> Date: Mon, 12 Jul 2010 17:04:20 -0400 From: David Rosenstrauch User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100624 Lanikai/3.1 MIME-Version: 1.0 To: user@avro.apache.org Subject: Re: Declaring array item types inline References: <4C3B6F8F.806@darose.net> <7EAB9713-F951-41C9-B3B8-DB957999BC88@richrelevance.com> In-Reply-To: <7EAB9713-F951-41C9-B3B8-DB957999BC88@richrelevance.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Yes, apparently so. I was getting a different parse error, and thought this was disallowed. Sorry for the noise. DR On 07/12/2010 04:59 PM, Scott Carey wrote: > 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 >