astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)
openapi-zod-client.vercel.app
717 stars 80 forks source link

fix: wrap properties beginning with a number in quotes #247

Closed tillschweneker closed 8 months ago

tillschweneker commented 8 months ago

When a property starts with a number, e.g. 1st, instead of first, the generated Zod-Schema is corrupt.

The change in the wrapWithQuotesIfNeeded method makes sure, that any property starting with a number is wrapped in quotes.

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openapi-zod-client ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2023 10:23am
astahmer commented 8 months ago

hey, LGTM ! could you add a test & a changeset ?

tillschweneker commented 8 months ago

@astahmer Done 👍