You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ambarish Pande (JIRA)" <ji...@apache.org> on 2017/12/05 10:19:00 UTC

[jira] [Created] (AVRO-2110) Incorrect example of enum type in documentation.

Ambarish Pande created AVRO-2110:
------------------------------------

             Summary: Incorrect example of enum type in documentation.
                 Key: AVRO-2110
                 URL: https://issues.apache.org/jira/browse/AVRO-2110
             Project: Avro
          Issue Type: Bug
    Affects Versions: 1.8.1
            Reporter: Ambarish Pande
            Priority: Minor


The documentation mentions this example:

{code:json}
{ 
"type": "enum",
  "name": "Suit",
  "symbols" : ["SPADES", "HEARTS", "DIAMONDS", "CLUBS"]
}
{code}


But using this in schema throws error:

"enum" is not a defined name. The type of the "Suit" field must be a defined name or a {"type": ...} expression.

Correct Example should be:

{code:json}
 {
      "name": "Suit",
      "type": {
        "name": "Suit",
        "type": "enum",
        "symbols" :  ["SPADES", "HEARTS", "DIAMONDS", "CLUBS"]
      }
    }
{code}


https://avro.apache.org/docs/1.8.1/spec.html#Enums



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)