獻輝黃 wrote:
I try to compile the Sample Protocol which on the Specification ,
when I use 「java org.apache.avro.specific.SpecificCompiler
<http://wiki.apache.org/hadoop/SpecificCompiler>」 to compile it,
it show the error message like *「Exception in thread "main"
org.apache.avro.SchemaParseException: org.codehaus.ja*
*ckson.JsonParseException: Unexpected character ('{' (code 123)): was
expecting comma to separate ARRAY entries』*
This is an error in the specification document.
I have filed an issue in Jira for this:
https://issues.apache.org/jira/browse/AVRO-125
The correct sample protocol is:
{
"namespace": "com.acme",
"protocol": "HelloWorld",
"types": [
{"name": "Greeting", "type": "record", "fields": [
{"name": "message", "type": "string"}]},
{"name": "Curse", "type": "error", "fields": [
{"name": "message", "type": "string"}]}
],
"messages": {
"hello": {
"request": [{"name": "greeting", "type": "Greeting" }],
"response": "Greeting",
"errors": ["Curse"]
}
}
}
Thank you for reporting this. It will be fixed in the documentation of
the next Avro release, 1.2.
Doug