woile opened a new issue, #476:
URL: https://github.com/apache/avro-rs/issues/476

   Hi, a schema like this is parsed correctly by avro-rs, this tests fails (it 
should err):
   
   ```rs
   fn test_wrong_enum() {
       let schema_str = r#"{
           "type": "record",
           "name": "ExampleEnum",
           "namespace": "com.schema",
           "fields": [
               {
               "name": "wrong_enum",
               "type": "enum",
               "symbols": ["INSERT", "UPDATE"]
               }
           ]
       }"#;
       let result = Schema::parse_str(schema_str);
       assert!(result.is_err());
   }
   ```
   
   While tools like `avro-tools` fail to create the enums with this schema.
   
   The problem is that `enum` should be defined inside `enum`, this would be a 
good looking example.
   Notice the `type.type.enum`:
   
   ```json
   {
     "type": "record",
     "name": "ExampleEnum",
     "namespace": "com.schema",
     "fields": [
       {
         "name": "wrong_enum",
         "type": {
           "name": "WrongEnum",
           "type": "enum",
           "symbols": ["INSERT", "UPDATE"]
         }
       }
     ]
   }
   ```
   
   I couldn't find any example in the specification of `type.enum`, and given 
that `avro-tools` fails to generate the java code, I assume `type.enum` is 
wrong. Let me know if that's not the case.
   
   Best.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to