I am using Confluent Platform for a MongoDB Sink Connector and I need to define an Avro schema in the Schema Registry so that data would be written in a structured manner to MongoDB Collection.
I have saved the following schema in a .avsc file:
{
"type": "record",
"name": "Transaction",
"namespace": "com.prxm",
"fields": [
{"name": "Timestamp", "type": "Date"},
{"name": "Price", "type": "double"},
{"name": "Qty", "type": "int"},
{"name": "Name", "type": "string"}
]
}
I tried to post this schema to Kafka Schema Registry using the following cURL command:
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data @transaction-schema.json http://localhost:8081/subjects/transaction-value/versions
And got the following error: {"error_code":42201,"message":"Empty schema"}. I Googled it and searched across Stackoverflow but didn't find a proper solution.
Confluent version: 7.3.2 Connect is UP and so is Schema Registry Running on Ubuntu 22 VM.
Any help would be appreciated.