1

I'm using apache.avro.tools version 1.11.0 to generate C# types from my avro schema.

Here is a portion of the schema:

"fields": [
  {
    "name": "ShipDate",
    "type": {
      "type": "int",
      "logicalType:": "date"
    }
  }
]

In the C# class the schema property contains ""fields"":[{""name"":""ShipDate"",""type"":""int""}. As you can see the logicalType is missing.

If I compare it to:

{
  "name": "BaseCost",
  "type": {
    "type": "bytes",
    "logicalType": "decimal",
    "precision": 7,
    "scale": 2,
  }
}

The C# class's schema property contains {\"name\":\"BaseCost\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":7,\"scale\":2}}.

Why has it swallowed some of the properties?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
NickL
  • 1,870
  • 2
  • 15
  • 35

1 Answers1

0

This was user error I'm afraid. The "logicalType:" field name has a semi-colon in it.

I'll give someone bonus points if they can tell me how to prevent errors like this in the future, with an avro-linter or something.

NickL
  • 1,870
  • 2
  • 15
  • 35