[ 
https://issues.apache.org/jira/browse/AVRO-1329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17103911#comment-17103911
 ] 

Martin Jubelgas commented on AVRO-1329:
---------------------------------------

I had considered a map, too, but having declarations for enum values similar to 
declarations to fields of an object felt better to me, but I'm open to 
suggestions, that's why I am tossing ideas here before implementing anything.

To me, it felt like, ideally, one should replace the "symbols" field with a 
more capable, extendable structure, but since just replacing the string with a 
JSON object will most likely be unacceptable for reasons of backwards 
compatibility, I'd basically leave in the "symbols" only to retain the 
backwards compatibility, to maybe be removed in something like AVRO 2.0 and 
move the imperative information to another field. (schema validation would have 
to make sure that both sources of information are conclusive with each other)

So basically, there's a couple of options:
 * for each extra information for the enums, add another parallel array (such 
as suggested by Doug in the original post), which I personally find the least 
charming way of doing it
 * add the extended information in one parallel array of json objects/maps 
(maybe the best compromise)
 * add the extended information in a map that optionally assigns extra 
information to respective symbols
 * define the symbols and their extensions in an array (which I consider would 
be the best solution if starting from a and clean slate) and keep the old array 
for backward compatibility

I haven't quite decided on what path I find preferrable, all things considered. 
Seems like each comes with its quirks.

> Get per-symbol doc for enums
> ----------------------------
>
>                 Key: AVRO-1329
>                 URL: https://issues.apache.org/jira/browse/AVRO-1329
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: doc
>    Affects Versions: 1.7.4
>            Reporter: Felix GV
>            Priority: Minor
>
> It would be nice to have the ability to add documentation for each symbol of 
> an enum.
> Doug Cutting, quoted from the mailing list:
> Documentation per enum symbol is not currently supported, but would not be 
> difficult to add. Please file an issue in Jira if you'd like to see this. For 
> compatibility, in Json, this would probably appear as a parallel array of 
> documentation strings, e.g., something like:
> ("name": "Foo", "type":"enum", "doc":"an enum", "symbols":["X","Y"], 
> "symbols-doc":["X is X", "Y is Y"]}



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

Reply via email to