Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Avro >> mail # user >> Experiment: a JSON Schema describing Avro schemas

Francis Galiegue 2013-02-22, 21:45
Doug Cutting 2013-02-22, 22:01
Francis Galiegue 2013-02-22, 22:04
Copy link to this message
Re: Experiment: a JSON Schema describing Avro schemas
On Fri, Feb 22, 2013 at 2:04 PM, Francis Galiegue <[EMAIL PROTECTED]> wrote:
> By default, JSON Schema allows additional members, it will only forbid
> them if additionalProperties is false (or constrain what they can be
> if additionalProperties is a schema)

I didn't realize that.  Thanks for clarifying.

> so the question would rather be,
> is there some scenarios where they are not allowed?

No, I think they should be allowed anywhere.

> Ah, OK. So you can have either a "full" name, a short name and a
> namespace, or even a "full" name and a namespace?

Yes, any of those three are valid.  (When no namespace is specified,
the namespace of the containing schema is implied.)

>>  - a schema can be the name of a schema defined earlier, e.g.
>> {"type":"record", "name":"List", "fields":[{"name":"next",
>> "type":[null, "List"]}]}
> I don't believe the schema forbids that at this point but I guess I'll
> have to check..

No, but you permit any string as a schema, rather than just primitives
and names.

A list of schemas to test this on in Avro's source are:


Additionally, one might alter the Schema parser & printer to log each
schema, then run unit tests and collect these, since there are many
more schemas that are constructed by the unit tests.  If you're
interested, I could try to construct a file of valid Avro schemas for
such testing.
Francis Galiegue 2013-02-22, 22:24
Francis Galiegue 2013-02-23, 01:44