【问题标题】:Kafka Schema Registry JSON Schema Restproxy IssueKafka Schema Registry JSON Schema Restproxy 问题
【发布时间】:2021-03-08 15:13:22
【问题描述】:

我正在尝试从 rest-proxy 发布 json 架构但遇到异常

curl -k -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"schema": "{"type":"object","properties":{ "firstname":{"type":"string"},"lastname":{"type":"string"},"age":{"type":"integer"}}}"}' https:// localhost:8081/subjects/schemaregistry.json-value/versions

是 json 模式格式错误吗?请指教

错误: {"error_code":42201,"message":"输入模式或其引用无效"}

【问题讨论】:

  • 您必须将架构完全编码为字符串,例如{"schema": "{\"type\":...

标签: apache-kafka confluent-schema-registry


【解决方案1】:
{"schema":"{\"type\":\"object\",\"properties\":{\"firstname\":{\"type\":\"string\"},\"lastname\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\"}}}", "schemaType":"JSON"}

"schemaType":"JSON" 是发布 json 模式所必需的

【讨论】:

    猜你喜欢
    • 2019-07-21
    • 1970-01-01
    • 2022-12-03
    • 1970-01-01
    • 2021-10-04
    • 1970-01-01
    • 2019-03-25
    • 2020-12-07
    • 2023-01-11
    相关资源
    最近更新 更多