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

C++ API compileJsonSchema ignores "doc" and custom attributes on a field/record


    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.9.0
    • Component/s: c++
    • Labels:
    • Environment:

      Running on all platforms (Windows, OSX, Linux)


      It appears that when my JSON is compiled into a valid schema object it is ignoring all types of "documentation" that I am trying to adorn with each field in my record. Reading through the Java issues it seems that this was a bug and fixed (AVRO-601, AVRO-612, AVRO-779) but it seems the C++ implementation has yet to adopt this feature? This is my sample schema, I have attempted to insert both "doc" and "mycustom" in multiple places to see if it is supported at any level. Please excuse if there appears to be a syntax error in the JSON I hand tweaked some of this. The schema is valid and successfully parses.

      "type": "record",
      "name": "myschema",
      "doc": "Doc Meta",
      "mycustom": "My Custom",
      "fields": [

      { "name":"field_a","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom A"}


      { "name":"field_b","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom B"}


      { "name":"field_c","type":["string","null"], "doc":"Doc Meta", "mycustom":"My Custom C"}


      I looked through the SchemaTests.cc code for 1.7.3 and there was not a test case for this there so i didn't think this was addressed in that version. I am running 1.7.2. When this schema is used to load with compileJsonSchema and then a file is serialized the file schema looks like this.

      "fields": [

      { "name":"field_a","type":["string","null"]}


      { "name":"field_b","type":["string","null"]}


      { "name":"field_c","type":["string","null"]}



        1. AVRO-1256.patch
          12 kB
          Pierre de Freminville

          Issue Links



              • Assignee:
                aniket486 Aniket Mokashi
                tmenninger Tim Menninger
              • Votes:
                1 Vote for this issue
                8 Start watching this issue


                • Created: