mtranter / zod-avsc

Zod schema objects to Avro Schema
1 stars 1 forks source link

Replace dashes with underscores to conform with Google PubSub Scheme #1

Open heitzerj-grapes opened 1 month ago

heitzerj-grapes commented 1 month ago

Hi, first of all great package! Was looking for something like this for a while until i found this. Im using the library to be able to define schemes in zod and be able to derive Types and Avro schemes from a single source.

It all works great, except for one thing: The package currently names array items ${name}-value. This does not conform with Googles PubSub Scheme, as it does not allow dashes. (https://github.com/mtranter/zod-avsc/blob/d41a64ce2fb8a62daf236a74e5ac753b9a2dc7d7/src/zod-to-avro.ts#L88)

Would you be open to replace the dash with an underscore, or are there specific reasons for the dash?

Thanks for considering!

heitzerj-grapes commented 3 weeks ago

I opened a PR (https://github.com/mtranter/zod-avsc/pull/2), if you feel inclined to merge it, awesome! If i missed something, just let me know.