0
votes

am trying to publish json schema from rest-proxy but getting exception

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

is the json schema format wrong? please advise

error: {"error_code":42201,"message":"Either the input schema or one its references is invalid"}

1
You'll have to fully encode the schema as a string like {"schema": "{\"type\":...OneCricketeer

1 Answers

0
votes
{"schema":"{\"type\":\"object\",\"properties\":{\"firstname\":{\"type\":\"string\"},\"lastname\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\"}}}", "schemaType":"JSON"}

"schemaType":"JSON" is mandatory to publish json schema