-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BE: Serde: Fix avro schema serde for nullable enums #685
BE: Serde: Fix avro schema serde for nullable enums #685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi DimaVilda! 👋
Welcome, and thank you for opening your first PR in the repo!
Please wait for triaging by our maintainers.
Please take a look at our contributing guide.
hey there! "name": "booksize" then kafka-ui createUnionSchema AFTER MY FIX OFC method will transform it to: "booksize": { Which will generate a message for topic like: { However a simple enum (not nullable) looks like: { "name": "booksize" Kafka-ui will generate: { or for null: { What do you think? Can I create a following issue for it and then proceed with this ? |
could you review it pls since we use kafka ui in our project and we would like to have this problem fixed, don't want to be pushy but when you have time pls check it |
api/src/main/java/io/kafbat/ui/util/jsonschema/AvroJsonSchemaConverter.java
Show resolved
Hide resolved
…r' into bugfix/fix_nullable_enum_avro_ser
@DimaVilda thanks! |
What changes did you make?
Fixed incorrect JSON schema generation for nullable enum types in Avro schemas. Previously, nullable enums were generated with generic "enum" key instead of the actual enum name, causing incorrect serialization format with error:
400 Bad Request
json value '{"enum":"CLUBS"}' is cannot be converted to any of union types
See bug reproduction in attached video!
Is there anything you'd like reviewers to focus on?
We can think about changing nullable enums json generation. I.e. instead of :
Simply use
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
kafkaUiBug.mp4