以 Kafka Avro 文件格式将新 Schema/Subject 添加到架构注册表

Add New Schema/Subject to Schema Registry in Kafka Avro file format

我正在尝试通过显式 curl 命令将架构 运行 架构到架构注册表。

curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json"  --data '{"schema" : {"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'  http://localhost:8081/subjects/avro-test/versions/

我收到以下错误 {"error_code":500,"message":"Internal Server Error"}

注意:我可以访问现有主题的数据,但在推送时出现相同的错误。

架构需要进行字符串转义

例如,开始

POST -d'{"schema": {\"type\":\"record\" 

如果可以,然后安装 jq 工具并创建一个 AVSC 文件,这将有所帮助 - see my comment here