astahmer / openapi-zod-client

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

Failed to generate types when schemas are not in a reticular structure #306

Open C-ra-ZY opened 2 months ago

C-ra-ZY commented 2 months ago

Describe the bug If there are no $ref in schemas, current code would skip the procedure of generating types, whereas the other outputs are normal, like schemas and endpoint. Although is not a common demand, spliting types info into a single file would take effect on decoupling and customization.

Minimal reproduction please see this page

Expected behavior the output should contain types information anyway like:

type DemoInformation = {
  issuedTo: string;
  token: string;
  expirationDate: string;
  group: string;
  identityId: string;
};

Additional context I have drafted fix.