Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2466

Fix a malformed schema in the share/test/schemas directory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.9.2
    • misc
    • None

    Description

      The schema defined in share/test/schemas/reserved.avsc is invalid because of its trailing comma:

      $ python -c 'from avro.schema import parse; parse(open("../../share/test/schemas/reserved.avsc").read())'
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/home/sekikn/repo/avro/lang/py/src/avro/schema.py", line 976, in parse
          json_data = json.loads(json_string)
        File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
          return _default_decoder.decode(s)
        File "/usr/lib/python2.7/json/decoder.py", line 367, in decode
          raise ValueError(errmsg("Extra data", s, end, len(s)))
      avro.schema.SchemaParseException: Error parsing JSON: {"name": "org.apache.avro.test.Reserved", "type": "enum",
       "symbols": ["default","class","int"]},
      , error = Extra data: line 2 column 39 - line 3 column 1 (char 96 - 98)
      $ cat ../../share/test/schemas/reserved.avsc
      {"name": "org.apache.avro.test.Reserved", "type": "enum",
       "symbols": ["default","class","int"]},
      

      This file doesn't seem to be used as far as I investigated, but I'd rather fix this than remove since it might be useful for some test.

      Attachments

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: