kafka-ui icon indicating copy to clipboard operation
kafka-ui copied to clipboard

add schema validation support for more json-schema version refs (closes #2354)

Open philosomniac opened this issue 1 year ago • 1 comments

  • [ ] Breaking change?

What changes did you make? Issue #2354 mentions that attempting to publish a message with schema validation will fail using a schema that references json-schema version draft-07. According to the Ajv docs, different json-schema versions (as referenced by the $schema property) require using different modules in Ajv. The current code always uses the draft-2020-12 module, which will throw errors if an earlier version of json-schema is referenced in the $schema property--so I added some code that will select the correct Ajv module based on the $schema property.

Is there anything you'd like reviewers to focus on? This is my very first open-source contribution--please be gentle! :)

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • [ ] No need to
  • [ ] Manually (please, describe, if necessary)
  • [x] Unit checks
  • [ ] Integration checks
  • [ ] Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • [x] My changes generate no new warnings (e.g. Sonar is happy)
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged) As requested--my favorite dog breed :)

philosomniac avatar Feb 28 '24 21:02 philosomniac

Hi @philosomniac, as this repo is no longer maintained (#4255), can I ask you to raise the same PR into our new repo (https://github.com/kafbat/kafka-ui)? Thank you

Haarolean avatar Apr 12 '24 17:04 Haarolean