radai rosenblatt created AVRO-2795:
--------------------------------------

             Summary: GenericData.EnumSymbol() does not validate the provided 
schema as actually an enum or that the literal is legal
                 Key: AVRO-2795
                 URL: https://issues.apache.org/jira/browse/AVRO-2795
             Project: Apache Avro
          Issue Type: Bug
            Reporter: radai rosenblatt


the following code does not throw any exceptions.
{code:java}
Schema notAnEnum = Schema.parse("{\"type\": \"record\", \"name\": \"NotEnum\", 
\"fields\": [{ \"name\": \"f\", \"type\": \"string\"}]}");
GenericData.EnumSymbol oopsie = new GenericData.EnumSymbol(notAnEnum, "illegal 
literal");{code}
however, later - when the symbol instance is actually used, things explode.

seems to be we can validate the Schema argument is of type enum and that the 
literal is a legal name?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to