You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Francis Galiegue <fg...@gmail.com> on 2013/03/02 10:09:26 UTC

Java API again: some malformed schemas don't throw SchemaParseException...

... But AvroRuntimeException. Namely, I tried this schema:

[ "null", "null" ]

Is this intentional?

-- 
Francis Galiegue, fgaliegue@gmail.com
JSON Schema in Java: http://json-schema-validator.herokuapp.com

Re: Java API again: some malformed schemas don't throw SchemaParseException...

Posted by Francis Galiegue <fg...@gmail.com>.
On Mon, Mar 4, 2013 at 6:34 PM, Doug Cutting <cu...@apache.org> wrote:
> I don't think that is intentional.
>
> Since SchemaParseException is a subclass of AvroRuntimeException, this
> can be changed back-compatibly, no?
>

While I haven't had a look at the code yet, I believe it can,
especially since a "real" malformed input (ie malformed JSON
representation of an Avro schema) raises SchemaParseException as well.

At "worst", yes, that change would be backwards compatible since
catching AvroRuntimeException also catches SchemaParseException by
definition. So, imho that would be a beneficial change.

-- 
Francis Galiegue, fgaliegue@gmail.com
JSON Schema in Java: http://json-schema-validator.herokuapp.com

Re: Java API again: some malformed schemas don't throw SchemaParseException...

Posted by Doug Cutting <cu...@apache.org>.
I don't think that is intentional.

Since SchemaParseException is a subclass of AvroRuntimeException, this
can be changed back-compatibly, no?

Doug

On Sat, Mar 2, 2013 at 1:09 AM, Francis Galiegue <fg...@gmail.com> wrote:
> ... But AvroRuntimeException. Namely, I tried this schema:
>
> [ "null", "null" ]
>
> Is this intentional?
>
> --
> Francis Galiegue, fgaliegue@gmail.com
> JSON Schema in Java: http://json-schema-validator.herokuapp.com