0

I don't want to use Microsoft.Hadoop.Avro. Is there any way to convert JSON data directly to Avro schema in C# and asp.net core API.

Example: Json Data: {"name":"John", "age":30, "car":null}

Avro Schema:

  "name": "MyClass",
  "type": "record",
  "namespace": "com.acme.avro",
  "fields": [
    {
      "name": "name",
      "type": "string"
    },
    {
      "name": "age",
      "type": "int"
    },
    {
      "name": "car",
      "type": [
        "string",
        "null"
      ]
    }
  ]
}```
Shashank Jain
  • 61
  • 1
  • 7
  • Does this answer your question? [Is there a way to convert JSON Data to avro schema in C#?](https://stackoverflow.com/questions/59464635/is-there-a-way-to-convert-json-data-to-avro-schema-in-c) – Peter Bons Sep 04 '21 at 10:45
  • That answer is using deprecated library and I already mentioned that I don't want to use Microsoft.Hadoop.Avro. @PeterBons – Shashank Jain Sep 04 '21 at 12:02
  • Ok, how about [this](https://stackoverflow.com/questions/45338832/can-a-c-sharp-model-be-serialized-as-an-avro-json-schema) – Peter Bons Sep 04 '21 at 12:21
  • Most of the answers are using "Microsoft.Hadoop.Avro.AvroSerializer". It is a deprecated package. So I don't want to use it in my application and it is the reason that I am looking for an alternative. @PeterBons – Shashank Jain Sep 18 '21 at 06:40

0 Answers0