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

C# parser allows incorrect syntax for record fields of a named type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.7.4
    • None
    • csharp
    • None
    • Schema class - org.apache.avro:avro:1.7.4
      Also confirmed in Avro 1.7.5 (RC)

    Description

      The following schema compiles successfully in Avro(c#), but in Avro(Java)returns a "Type not supported: Invoice" when parsing the "ListOfInvoices" array.
      Problem appears to be in the parse method. {"items": "Invoice"} does not properly parse to find the "Invoice" type.

      { "namespace": "SampleClasses",
      "name": "Batch",
      "type": "record",
      "fields": [
      { "name": "Invoices", "type": {
      "type": "array",
      "items": {
      "name": "Invoice",
      "type": "record",
      "fields": [

      { "name": "Id", "type": "string" }

      ]
      }
      }
      },

      { "name": "SingleInvoice", "type": "Invoice" }

      , // This reference to "Invoice" works fine.
      { "name": "ListOfInvoices", "type": {
      "type": "array", "items":

      { "type": "Invoice" }

      // Fails - does not get previous definition of "Invoice"
      }
      }
      ]
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            bill baird Bill Baird
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: