Update forked avro plugin
ImFlog opened this issue · 1 comments
ImFlog commented
It's been a long time since I didn't do it, could be good to avoid too big desynchronization.
ImFlog commented
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 atype
or anarray
?
-> Probably because else we could also replacename
values for instance
💡 We could use a regexp to find the local reference and then check if it's atype
or anarray
or anunion
? => 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.