Skip to content

can't update JSON Schema to AVRO with pulsar-admin #5088

@ghost

Description

Describe the bug
Changing just the type of schema does not work

To Reproduce
Steps to reproduce the behavior:

  1. create a file /tmp/yoshi containing:
{
    "type": "JSON",
    "schema": "{\"type\":\"record\",\"name\":\"User\",\"namespace\":\"com.foo\",\"fields\":[{\"name\":\"file1\",\"type\":[\"null\",\"string\"],\"default\":null},{\"name\":\"file2\",\"type\":\"string\",\"default\":null},{\"name\":\"file3\",\"type\":[\"null\",\"string\"],\"default\":\"dfdf\"}]}",
    "properties": {}
}
  1. now type pulsar-admin schemas upload -f /tmp/yoshi persistent://public/default/yoshi to upload the schema
  2. now type pulsar-admin schemas get persistent://public/default/yoshi
    the result will say:
...
 "type": "JSON",
...

which is ok
4. edit /tmp/yoshi and change

...
  "type": "AVRO",
...
  1. now type pulsar-admin schemas upload -f /tmp/yoshi persistent://public/default/yoshi to upload the schema
  2. now type pulsar-admin schemas get persistent://public/default/yoshi
    the result will say:
...
 "type": "JSON",
...

it should say instead 'AVRO'

Desktop (please complete the following information):

  • macos, pulsar-all docker image 2.4.0 standalone

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe PR fixed a bug or issue reported a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions