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

George Fletcher commented on AVRO-965:
--------------------------------------

You are correct. I meant Props not Property:) I'll refactor to just reference 
Schema.Props in Protocol.java.

I tried modifying MessageDeclaration like this
{code}
Message MessageDeclaration(Protocol p):
{
  String msgDoc;
  String name;
  Schema request;
  Schema response;
  boolean oneWay = false;
  List<Schema> errorSchemata = new ArrayList<Schema>();
  errorSchemata.add(Protocol.SYSTEM_ERROR);
  Map<String, JsonNode> props = new LinkedHashMap<String, JsonNode>();
  Map<String, String> propMap = new LinkedHashMap<String, String>();
}
{
  msgDoc = MessageDocumentation()
  ( SchemaProperty(props) )*
  response = ResultType()
  name = Identifier()
  request = FormalParameters()
  [ "oneway" {oneWay = true; } | "throws" ErrorList(errorSchemata) ]
  ";"
  {
    for (String key : props.keySet())
      if (props.get(key).isTextual()) {    // ignore other non-textual
        propMap.put(key, getTextProp(key, props, token));
      }
    ...
{code}

However, the issue isn't in parsing the MessageDeclaration but rather when the 
parser is processing the NamedSchemaDeclaration. In this case, the 
NamedSchemaDeclaration matches because of the @propName() construct but then 
expects the resulting object to be a named schema and not a message 
declaration. It seems like I'd need to modify NamedSchemaDeclaration but I 
didn't want to start down that path as that seems like a bigger change than 
necessary.
                
> Enhance the IDL parser to allow properties for protocols and messages
> ---------------------------------------------------------------------
>
>                 Key: AVRO-965
>                 URL: https://issues.apache.org/jira/browse/AVRO-965
>             Project: Avro
>          Issue Type: Improvement
>            Reporter: George Fletcher
>            Priority: Minor
>
> Enhance the IDL parser to support arbitrary properties for protocol and 
> message types. This will allow for attaching metadata to a protocol or 
> message and can be used for versioning and in some cases language annotations.
> This was partly discussed as part of JIRA ticket 886
> https://issues.apache.org/jira/browse/AVRO-886

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to