Skip to content
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

Update forked avro plugin #162

Open
ImFlog opened this issue Jan 10, 2024 · 1 comment
Open

Update forked avro plugin #162

ImFlog opened this issue Jan 10, 2024 · 1 comment
Labels
dependencies Pull requests that update a dependency file

Comments

@ImFlog
Copy link
Owner

ImFlog commented Jan 10, 2024

It's been a long time since I didn't do it, could be good to avoid too big desynchronization.

@ImFlog ImFlog added the dependencies Pull requests that update a dependency file label Jan 22, 2024
@ImFlog
Copy link
Owner Author

ImFlog commented Feb 3, 2024

I tried a bit to update the plugin but it's pretty hard to maintain as I cannot cleanly add a new piece of code without being impacted by the changes in Avro code.

So I got a new idea 💡

We could treat the schema as a string and not as a Json Schema object. And thus:

  • Search for local reference names in the schema (in reverse, starting with the top level references)
  • For each one, replace by the content of the local reference schema
    ⚠️ Do we need to do some kind of check before replacing ? For instance that it's a type or an array ?
    -> Probably because else we could also replace name values for instance
    💡 We could use a regexp to find the local reference and then check if it's a type or an array or an union ? => Might be hard if everything is on the same line
    -> This is only 3 cases, we can find 3 regexp that match. Maybe we can prettify the schema before to make it easier to find the local reference.
  • If the local reference is not found, we could throw an error
  • Then classic schema registry parsing

Need to POC this to see if it works. What's cool is that we already have the tests written so it's pretty simple to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

1 participant