astahmer / openapi-zod-client

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

Typings issue - SwaggerParser and openapi3-ts #144

Open ArthurGoupil opened 1 year ago

ArthurGoupil commented 1 year ago

Hi!

I'm using the package programmatically as shown here https://github.com/astahmer/openapi-zod-client/blob/main/examples/basic/petstore-generator.ts

But I don't understand the type casting. The generateZodClientFromOpenAPI method expects an OpenAPIObject doc (openapi3-ts) while SwaggerParser provides an OpenAPI.Document doc (openapi-types).

Also, this type casting doesn't work with openapi3-ts latest version.

Would it be possible to use SwaggerParser types?

Thanks!

astahmer commented 1 year ago

yeah it's probably outdated at this point, feel free to open a PR to use SwaggerParser types 🙏