Relative Content

Tag Archive for typescriptundefinedavro

How to map undefined and null to avro types

In our team, we have a TypeScript app owning enum data that we want to convert into an avro message. The problem is now, in TypeScript the data can have a value, or be null, or undefined. The case of null should be treated as an actual value (“reset this value to null”), while undefined should be simply ignored (“don’t do anything”) on the receiver side. Are there a battle-tested patterns of designing the avro schema for such cases?