rakesh kandukuri
rakesh kandukuri

Reputation: 305

Kafka Schema Registry JSON Schema Restproxy Issue

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"}

Upvotes: 0

Views: 822

Answers (1)

rakesh kandukuri
rakesh kandukuri

Reputation: 305

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

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

Upvotes: 1

Related Questions