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

Missing endpoints when parsing OpenAPI 3.0.3 schema

micah-redwood opened this issue · comments

Hi, first of thanks for this really nifty library.

I've been using openapi-typescript to transform an OpenAPI 3.0.3 schema into Typescript types, and am working on migrating to using your library instead to generate a Zodios client. Unfortunately, when I do this most of the API endpoints in the OpenAPI schema are not added to Zodios. Same thing happens when I use the playground. I'm guessing there's a part of the OpenAPI schema that openapi-typescript supports but this library doesn't support yet?

Here are the files I'm working with, generated from the Sortly REST API. I appended .txt so Github would let me upload them.
https://sortlyapi.docs.apiary.io/

Thanks!

hey, this is because most of your endpoints don't have a "schema" object on the MediaTypeObject (xxx.content[yyy].schema <- should be here) and it hasn't been handled nor requested yet, surprisingly

i'll publish a fix soon ! sorry for the inconvenience

just released it on openapi-zod-client@1.5.0

you can also try it on the playground https://openapi-zod-client.vercel.app/

Awesome, thanks @astahmer !