astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

Home Page:openapi-zod-client.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typings issue - SwaggerParser and openapi3-ts

ArthurGoupil opened this issue · comments

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!

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