Kriskras99 commented on code in PR #479:
URL: https://github.com/apache/avro-rs/pull/479#discussion_r2842229936
##########
avro/src/schema/mod.rs:
##########
@@ -5438,4 +5401,26 @@ mod tests {
Ok(())
}
+
+ #[test]
+ fn avro_rs_476_enum_cannot_be_directly_in_field() -> TestResult {
+ 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).unwrap_err();
+ assert_eq!(
+ result.to_string(),
+ "Invalid schema: There is no type called 'enum', if you meant to
define a non-primitive schema, it should be defined inside `type` attribute.
Please review the specification"
Review Comment:
I've removed the entire `Please review the specification`/`Please consult
with the specification` bit
--
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]