Avro schema upload with pulsar admin being rejected #21560
Replies: 4 comments 3 replies
-
|
the upload works if I change the schema type to from |
Beta Was this translation helpful? Give feedback.
-
|
Hello @estebanz01! Which version of Pulsar are you using? |
Beta Was this translation helpful? Give feedback.
-
|
OK, I found the issue by doing curl requests to the following endpoint: https://pulsar.apache.org/admin-rest-api/?version=3.1.1#operation/SchemasResource_testCompatibility The response gave me the full error trace so I was able to see what was happening. Basically, the complex types need to be defined as json objects too, so {"name": "device_content", "type": {"type": "map", "values": "string", "default": {}}}It took too long to figure it out 😄 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hola! 👋
I've been trying to upload an schema with pulsar admin CLI tool but I'm getting hit by the following error:
2023-11-10T08:49:06,329-0500 [AsyncHttpClient-7-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/schemas/public/iot/device_1/schema] Failed to perform http post request: javax.ws.rs.ClientErrorException: HTTP 422 { "servlet":"org.glassfish.jersey.servlet.ServletContainer-43cb5f38", "message":"Invalid schema definition data for AVRO schema", "url":"/admin/v2/schemas/public/iot/device_1/schema", "status":"422" }Any ideas on why it does not work? here's the schema
{ "name": "data-schema", "type": "AVRO", "schema": "{\"type\": \"record\", \"namespace\": \"iot\",\"name\":\"exampleAvro\",\"fields\":[{\"name\": \"device_name\",\"type\": \"string\"},{\"name\": \"data_content\", \"type\": \"map\", \"values\": \"string\"},{\"name\": \"device_properties\", \"type\": \"map\", \"values\": \"string\"},{\"name\":\"datetime_info\", \"type\": \"string\"}, {\"name\": \"topicName\", \"type\": \"string\"}]}", "properties": { "__jsr310ConversionEnabled": "false" } }and here's the schema in a pretty format:
{ "type": "record", "namespace": "iot", "name": "exampleAvro", "fields": [ { "name": "device_name", "type": "string" }, { "name": "data_content", "type": "map", "values": "string" }, { "name": "device_properties", "type": "map", "values": "string" }, { "name": "datetime_info", "type": "string" }, { "name": "topicName", "type": "string" } ] }Beta Was this translation helpful? Give feedback.
All reactions