{"_id":"@cumhuronat/openapi-zod-client","_rev":"3-bcd53dd5f50f627e754e7e34849ed4b0","name":"@cumhuronat/openapi-zod-client","dist-tags":{"latest":"1.18.6"},"versions":{"1.18.4":{"name":"@cumhuronat/openapi-zod-client","version":"1.18.4","keywords":["openapi","swagger","zod","client","zodios","generator","typescript"],"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"license":"ISC","_id":"@cumhuronat/openapi-zod-client@1.18.4","maintainers":[{"name":"cumhuronat","email":"cumhuronat@gmail.com"}],"homepage":"https://github.com/astahmer/openapi-zod-client","bugs":{"url":"https://github.com/astahmer/openapi-zod-client/issues"},"bin":{"openapi-zod-client":"bin.js"},"dist":{"shasum":"07e6070d2fadca34af2cd030479dfd6c1c68b406","tarball":"https://registry.npmjs.org/@cumhuronat/openapi-zod-client/-/openapi-zod-client-1.18.4.tgz","fileCount":38,"integrity":"sha512-mTzpCezgMLcdCUiwReRfl+DKwqOYOAVmMykYdyowaWVc5jOZsgrp+zK8MBcECj38RFvvRPztSu2V8Kpip3wDYQ==","signatures":[{"sig":"MEYCIQD2+dgtO49oOirFGcpnCMDqir/0FskNM3U2exMcGlInwAIhAJBJPX4/hm8fKTrgc5tRIgpEIsGxnVdsLb9JDfmbdAeK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":406494},"main":"dist/openapi-zod-client.cjs.js","_from":"file:cumhuronat-openapi-zod-client-1.18.4.tgz","types":"./dist/openapi-zod-client.cjs.d.ts","module":"dist/openapi-zod-client.esm.js","scripts":{"lint":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty","test":"vitest","lint:ts":"tsc --noEmit","test:ci":"vitest run","lint:fix":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty --fix"},"_npmUser":{"name":"cumhuronat","email":"cumhuronat@gmail.com"},"_resolved":"C:\\Users\\cumhur\\AppData\\Local\\Temp\\8eeb6d281860ffb834d8d091e2b3f3f4\\cumhuronat-openapi-zod-client-1.18.4.tgz","_integrity":"sha512-mTzpCezgMLcdCUiwReRfl+DKwqOYOAVmMykYdyowaWVc5jOZsgrp+zK8MBcECj38RFvvRPztSu2V8Kpip3wDYQ==","repository":{"url":"git+https://github.com/astahmer/openapi-zod-client.git","type":"git"},"_npmVersion":"10.9.2","description":"[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"cac":"^6.7.14","zod":"^3.19.1","tanu":"^0.1.13","axios":"^1.6.0","whence":"^2.0.0","pastable":"^2.2.1","prettier":"^2.7.1","handlebars":"^4.7.7","ts-pattern":"^5.0.1","openapi3-ts":"3.1.0","@zodios/core":"^10.3.1","openapi-types":"^12.0.2","@liuli-util/fs-extra":"^0.1.0","@apidevtools/swagger-parser":"^10.1.0"},"preconstruct":{"entrypoints":["index.ts","cli.ts"]},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"degit":"^2.8.4","eslint":"^8.26.0","vitest":"^0.22.1","fast-glob":"^3.2.12","type-fest":"^2.19.0","typescript":"^5.1.6","@types/node":"^18.11.4","@types/degit":"^2.8.3","@types/js-yaml":"^4.0.5","@types/fs-extra":"^9.0.13","@types/prettier":"^2.7.1","eslint-formatter-pretty":"^4.1.0","@typescript-eslint/parser":"^5.40.1","@astahmer/eslint-config-ts":"^0.1.5","@typescript-eslint/eslint-plugin":"^5.40.1"},"_npmOperationalInternal":{"tmp":"tmp/openapi-zod-client_1.18.4_1746377998583_0.3489919422137251","host":"s3://npm-registry-packages-npm-production"}},"1.18.5":{"name":"@cumhuronat/openapi-zod-client","version":"1.18.5","keywords":["openapi","swagger","zod","client","zodios","generator","typescript"],"author":{"url":"Original author: Alexandre Stahmer <alexandre.stahmer@gmail.com>","name":"Cumhur Onat","email":"cumhuronat@gmail.com"},"license":"ISC","_id":"@cumhuronat/openapi-zod-client@1.18.5","maintainers":[{"name":"cumhuronat","email":"cumhuronat@gmail.com"}],"homepage":"https://github.com/cumhuronat/openapi-zod-client","bugs":{"url":"https://github.com/cumhuronat/openapi-zod-client/issues"},"bin":{"openapi-zod-client":"bin.js"},"dist":{"shasum":"948e2a6cbc7acb2c23491ef2939c44148bb335a9","tarball":"https://registry.npmjs.org/@cumhuronat/openapi-zod-client/-/openapi-zod-client-1.18.5.tgz","fileCount":65,"integrity":"sha512-t/MPIxIKtNu6PKumDORo7/PNMCZ4I1nVRtu42bOhHL30eJWdI8q954VJV71+WQXX6GCFqeh14Z0pS9TChJF+Cw==","signatures":[{"sig":"MEUCIQDkAxcx2nLy1WAWrewAlY3vj2kGr2nB66QE2wu7DYlY9wIgLEz4hJ3US/JS4Z5QnsNw5N+Bsxlj6BHgiZ+UIhK3SRg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":782514},"main":"dist/openapi-zod-client.cjs.js","_from":"file:cumhuronat-openapi-zod-client-1.18.5.tgz","types":"./dist/openapi-zod-client.cjs.d.ts","module":"dist/openapi-zod-client.esm.js","scripts":{"lint":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty","test":"vitest","lint:ts":"tsc --noEmit","test:ci":"vitest run","lint:fix":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty --fix"},"_npmUser":{"name":"cumhuronat","email":"cumhuronat@gmail.com"},"_resolved":"C:\\Users\\cumhur\\AppData\\Local\\Temp\\8810f531777385fff9fbe3f584dbc70f\\cumhuronat-openapi-zod-client-1.18.5.tgz","_integrity":"sha512-t/MPIxIKtNu6PKumDORo7/PNMCZ4I1nVRtu42bOhHL30eJWdI8q954VJV71+WQXX6GCFqeh14Z0pS9TChJF+Cw==","repository":{"url":"git+https://github.com/cumhuronat/openapi-zod-client.git","type":"git"},"_npmVersion":"10.9.2","description":"[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"cac":"^6.7.14","zod":"^3.19.1","tanu":"^0.1.13","axios":"^1.6.0","whence":"^2.0.0","pastable":"^2.2.1","prettier":"^2.7.1","handlebars":"^4.7.7","ts-pattern":"^5.0.1","openapi3-ts":"3.1.0","@zodios/core":"^10.3.1","openapi-types":"^12.0.2","@liuli-util/fs-extra":"^0.1.0","@apidevtools/swagger-parser":"^10.1.0"},"preconstruct":{"entrypoints":["index.ts","cli.ts"]},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"degit":"^2.8.4","eslint":"^8.26.0","vitest":"^0.22.1","fast-glob":"^3.2.12","type-fest":"^2.19.0","typescript":"^5.1.6","@types/node":"^18.11.4","@types/degit":"^2.8.3","@types/js-yaml":"^4.0.5","@types/fs-extra":"^9.0.13","@types/prettier":"^2.7.1","eslint-formatter-pretty":"^4.1.0","@typescript-eslint/parser":"^5.40.1","@astahmer/eslint-config-ts":"^0.1.5","@typescript-eslint/eslint-plugin":"^5.40.1"},"_npmOperationalInternal":{"tmp":"tmp/openapi-zod-client_1.18.5_1746378658479_0.8623350529588742","host":"s3://npm-registry-packages-npm-production"}},"1.18.6":{"name":"@cumhuronat/openapi-zod-client","version":"1.18.6","repository":{"type":"git","url":"git+https://github.com/cumhuronat/openapi-zod-client.git"},"author":{"name":"Cumhur Onat","email":"cumhuronat@gmail.com","url":"Original author: Alexandre Stahmer <alexandre.stahmer@gmail.com>"},"main":"dist/openapi-zod-client.cjs.js","module":"dist/openapi-zod-client.esm.js","homepage":"https://github.com/cumhuronat/openapi-zod-client","bin":{"openapi-zod-client":"bin.js"},"license":"ISC","dependencies":{"@apidevtools/swagger-parser":"^10.1.0","@liuli-util/fs-extra":"^0.1.0","@zodios/core":"^10.3.1","axios":"^1.6.0","cac":"^6.7.14","handlebars":"^4.7.7","openapi-types":"^12.0.2","openapi3-ts":"3.1.0","pastable":"^2.2.1","prettier":"^2.7.1","tanu":"^0.1.13","ts-pattern":"^5.0.1","whence":"^2.0.0","zod":"^3.19.1"},"devDependencies":{"@astahmer/eslint-config-ts":"^0.1.5","@types/degit":"^2.8.3","@types/fs-extra":"^9.0.13","@types/js-yaml":"^4.0.5","@types/node":"^18.11.4","@types/prettier":"^2.7.1","@typescript-eslint/eslint-plugin":"^5.40.1","@typescript-eslint/parser":"^5.40.1","degit":"^2.8.4","eslint":"^8.26.0","eslint-formatter-pretty":"^4.1.0","fast-glob":"^3.2.12","type-fest":"^2.19.0","typescript":"^5.1.6","vitest":"^0.22.1"},"preconstruct":{"entrypoints":["index.ts","cli.ts"]},"keywords":["openapi","swagger","zod","client","zodios","generator","typescript"],"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"test":"vitest","test:ci":"vitest run","lint:ts":"tsc --noEmit","lint":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty","lint:fix":"eslint -c .eslintrc.build.js './src/**/*.ts' --cache --format=pretty --fix"},"_id":"@cumhuronat/openapi-zod-client@1.18.6","types":"./dist/openapi-zod-client.cjs.d.ts","description":"[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)","bugs":{"url":"https://github.com/cumhuronat/openapi-zod-client/issues"},"_integrity":"sha512-Hc5yYNPgNizd6elZng+acEKyWZJYK7lzzV1MzIX9C+434Anhw/d/5/iYV3GRyAuRTXjQ8LeQItQVcX6AsmARjQ==","_resolved":"C:\\Users\\cumhur\\AppData\\Local\\Temp\\0080bba2cd89ae0b273fe6b668441103\\cumhuronat-openapi-zod-client-1.18.6.tgz","_from":"file:cumhuronat-openapi-zod-client-1.18.6.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Hc5yYNPgNizd6elZng+acEKyWZJYK7lzzV1MzIX9C+434Anhw/d/5/iYV3GRyAuRTXjQ8LeQItQVcX6AsmARjQ==","shasum":"81bbd437ea07d55b8dc35abac443b26bbcb48ccc","tarball":"https://registry.npmjs.org/@cumhuronat/openapi-zod-client/-/openapi-zod-client-1.18.6.tgz","fileCount":65,"unpackedSize":782261,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC6PKT3vPM0nU9Oljpve9WW3e9kj6WY+ZrdBI4UhVSOUQIgUO67XDhMINX4xdus2Q+DEHLSLFRSAaDug+TkSyMrWIg="}]},"_npmUser":{"name":"cumhuronat","email":"cumhuronat@gmail.com"},"directories":{},"maintainers":[{"name":"cumhuronat","email":"cumhuronat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openapi-zod-client_1.18.6_1746380292726_0.7713992660991984"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-04T16:59:58.503Z","modified":"2025-05-04T17:38:13.116Z","1.18.4":"2025-05-04T16:59:58.805Z","1.18.5":"2025-05-04T17:10:58.805Z","1.18.6":"2025-05-04T17:38:12.932Z"},"bugs":{"url":"https://github.com/cumhuronat/openapi-zod-client/issues"},"author":{"name":"Cumhur Onat","email":"cumhuronat@gmail.com","url":"Original author: Alexandre Stahmer <alexandre.stahmer@gmail.com>"},"license":"ISC","homepage":"https://github.com/cumhuronat/openapi-zod-client","keywords":["openapi","swagger","zod","client","zodios","generator","typescript"],"repository":{"type":"git","url":"git+https://github.com/cumhuronat/openapi-zod-client.git"},"description":"[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)","maintainers":[{"name":"cumhuronat","email":"cumhuronat@gmail.com"}],"readme":"# openapi-zod-client\r\n\r\n[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)\r\n\r\nGenerates a [zodios](https://github.com/ecyrbe/zodios) (_typescript http client with zod validation_) from a (json/yaml) [OpenAPI spec](https://github.com/OAI/OpenAPI-Specification) **(or just use the generated schemas/endpoints/etc !)**\r\n\r\n-   can be used programmatically _(do w/e you want with the computed schemas/endpoints)_\r\n-   or used as a CLI _(generates a prettier .ts file with deduplicated variables when pointing to the same schema/$ref)_\r\n\r\n-   client typesafety using [zodios](https://github.com/ecyrbe/zodios)\r\n-   tested (using [vitest](https://vitest.dev/)) against official [OpenAPI specs samples](https://github.com/OAI/OpenAPI-Specification/tree/main/schemas)\r\n\r\n# Why this exists\r\n\r\nsometimes you don't have control on your API, maybe you need to consume APIs from other teams (who might each use a different language/framework), you only have their Open API spec as source of truth, then this might help 😇\r\n\r\nyou could use `openapi-zod-client` to automate the API integration part (doesn't matter if you consume it in your front or back-end, zodios is agnostic) on your CI and just import the generated `api` client\r\n\r\n## Comparison vs tRPC etc\r\n\r\nplease just use [tRPC](https://github.com/trpc/trpc) or alternatives ([zodios](https://www.zodios.org/) is actually a full-featured solution and not just an api client, [ts-rest](https://ts-rest.com/) looks cool as well) if you do have control on your API/back-end\r\n\r\n# Usage\r\n\r\nwith local install:\r\n\r\n-   `pnpm i -D openapi-zod-client`\r\n-   `pnpm openapi-zod-client \"./input/file.json\" -o \"./output/client.ts\"`\r\n\r\nor directly (no install)\r\n\r\n-   `pnpx openapi-zod-client \"./input/file.yaml\" -o \"./output/client.ts\"`\r\n\r\n# auto-generated doc\r\n\r\nhttps://paka.dev/npm/openapi-zod-client\r\n\r\n## CLI\r\n\r\n```sh\r\nopenapi-zod-client/1.4.2\r\n\r\nUsage:\r\n  $ openapi-zod-client <input>\r\n\r\nCommands:\r\n  <input>  path/url to OpenAPI/Swagger document as json/yaml\r\n\r\nFor more info, run any command with the `--help` flag:\r\n  $ openapi-zod-client --help\r\n\r\nOptions:\r\n  -o, --output <path>       Output path for the zodios api client ts file (defaults to `<input>.client.ts`)\r\n  -t, --template <path>     Template path for the handlebars template that will be used to generate the output\r\n  -p, --prettier <path>     Prettier config path that will be used to format the output client file\r\n  -b, --base-url <url>      Base url for the api\r\n  -a, --with-alias          With alias as api client methods\r\n  --error-expr <expr>       Pass an expression to determine if a response status is an error\r\n  --success-expr <expr>     Pass an expression to determine which response status is the main success status\r\n  --media-type-expr <expr>  Pass an expression to determine which response content should be allowed\r\n  --export-schemas          When true, will export all `#/components/schemas`\r\n  --implicit-required       When true, will make all properties of an object required by default (rather than the current opposite), unless an explicitly `required` array is set\r\n  --with-deprecated         when true, will keep deprecated endpoints in the api output\r\n  --group-strategy          groups endpoints by a given strategy, possible values are: 'none' | 'tag' | 'method' | 'tag-file' | 'method-file'\r\n  --complexity-threshold    schema complexity threshold to determine which one (using less than `<` operator) should be assigned to a variable\r\n  --default-status          when defined as `auto-correct`, will automatically use `default` as fallback for `response` when no status code was declared\r\n  -v, --version             Display version number\r\n  -h, --help                Display this message\r\n```\r\n\r\n## Customization\r\n\r\nYou can pass a custom [handlebars](https://handlebarsjs.com/) template and/or a [custom prettier config](https://prettier.io/docs/en/configuration.html) with something like:\r\n\r\n`pnpm openapi-zod-client ./example/petstore.yaml -o ./example/petstore-schemas.ts -t ./example/schemas-only.hbs -p ./example/prettier-custom.json --export-schemas`, there is an example of the output [here](./examples/schemas-only/petstore-schemas.ts)\r\n\r\n## When using the CLI\r\n\r\n-   `--success-expr` is bound to [`isMainResponseStatus`](https://github.com/astahmer/openapi-zod-client/blob/b7717b53023728d077ceb2f451e4787f32945b3d/src/generateZodClientFromOpenAPI.ts#L234-L244)\r\n-   `--error-expr` is bound to [`isErrorStatus`](https://github.com/astahmer/openapi-zod-client/blob/b7717b53023728d077ceb2f451e4787f32945b3d/src/generateZodClientFromOpenAPI.ts#L245-L256)\r\n\r\nYou can pass an expression that will be safely evaluted (thanks to [whence](https://github.com/jonschlinkert/whence/)) and works like `validateStatus` from axios to determine which OpenAPI `ResponseItem` should be picked as the main one for the `ZodiosEndpoint[\"response\"]` and which ones will be added to the `ZodiosEndpoint[\"errors\"]` array.\r\n\r\nExemple: `--success-expr \"status >= 200 && status < 300\"`\r\n\r\n## Tips\r\n\r\n-   You can omit the `-o` (output path) argument if you want and it will default to the input path with a `.ts` extension: `pnpm openapi-zod-client ./input.yaml` will generate a `./input.yaml.ts` file\r\n-   Since internally we're using [swagger-parser](https://github.com/APIDevTools/swagger-parser), you should be able to use an URL as input like this:\r\n    `pnpx openapi-zod-client https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml -o ./petstore.ts`\r\n\r\n-   Also, multiple-files-documents ($ref pointing to another file) should work out-of-the-box as well, but if it doesn't, maybe [dereferencing](https://apitools.dev/swagger-parser/docs/swagger-parser.html#dereferenceapi-options-callback) your document before passing it to `openapi-zod-client` could help\r\n\r\n## Example\r\n\r\n-   You can check an example [input](./examples/petstore.yaml) (the petstore example when you open/reset [editor.swagger.io](https://editor.swagger.io/)) and [output](./examples/basic/petstore-client.ts)\r\n-   there's also [an example of a programmatic usage](./examples/basic/petstore-generator.ts)\r\n-   or you can check the tests in the `src` folder which are mostly just inline snapshots of the outputs\r\n\r\n# tl;dr\r\n\r\n[input](./samples/v3.0/petstore.yaml):\r\n\r\n```yaml\r\nopenapi: \"3.0.0\"\r\ninfo:\r\n    version: 1.0.0\r\n    title: Swagger Petstore\r\n    license:\r\n        name: MIT\r\nservers:\r\n    - url: http://petstore.swagger.io/v1\r\npaths:\r\n    /pets:\r\n        get:\r\n            summary: List all pets\r\n            operationId: listPets\r\n            tags:\r\n                - pets\r\n            parameters:\r\n                - name: limit\r\n                  in: query\r\n                  description: How many items to return at one time (max 100)\r\n                  required: false\r\n                  schema:\r\n                      type: integer\r\n                      format: int32\r\n            responses:\r\n                \"200\":\r\n                    description: A paged array of pets\r\n                    headers:\r\n                        x-next:\r\n                            description: A link to the next page of responses\r\n                            schema:\r\n                                type: string\r\n                    content:\r\n                        application/json:\r\n                            schema:\r\n                                $ref: \"#/components/schemas/Pets\"\r\n                default:\r\n                    description: unexpected error\r\n                    content:\r\n                        application/json:\r\n                            schema:\r\n                                $ref: \"#/components/schemas/Error\"\r\n        post:\r\n            summary: Create a pet\r\n            operationId: createPets\r\n            tags:\r\n                - pets\r\n            responses:\r\n                \"201\":\r\n                    description: Null response\r\n                default:\r\n                    description: unexpected error\r\n                    content:\r\n                        application/json:\r\n                            schema:\r\n                                $ref: \"#/components/schemas/Error\"\r\n    /pets/{petId}:\r\n        get:\r\n            summary: Info for a specific pet\r\n            operationId: showPetById\r\n            tags:\r\n                - pets\r\n            parameters:\r\n                - name: petId\r\n                  in: path\r\n                  required: true\r\n                  description: The id of the pet to retrieve\r\n                  schema:\r\n                      type: string\r\n            responses:\r\n                \"200\":\r\n                    description: Expected response to a valid request\r\n                    content:\r\n                        application/json:\r\n                            schema:\r\n                                $ref: \"#/components/schemas/Pet\"\r\n                default:\r\n                    description: unexpected error\r\n                    content:\r\n                        application/json:\r\n                            schema:\r\n                                $ref: \"#/components/schemas/Error\"\r\ncomponents:\r\n    schemas:\r\n        Pet:\r\n            type: object\r\n            required:\r\n                - id\r\n                - name\r\n            properties:\r\n                id:\r\n                    type: integer\r\n                    format: int64\r\n                name:\r\n                    type: string\r\n                tag:\r\n                    type: string\r\n        Pets:\r\n            type: array\r\n            items:\r\n                $ref: \"#/components/schemas/Pet\"\r\n        Error:\r\n            type: object\r\n            required:\r\n                - code\r\n                - message\r\n            properties:\r\n                code:\r\n                    type: integer\r\n                    format: int32\r\n                message:\r\n                    type: string\r\n```\r\n\r\noutput:\r\n\r\n```ts\r\nimport { makeApi, Zodios } from \"@zodios/core\";\r\nimport { z } from \"zod\";\r\n\r\nconst Pet = z.object({ id: z.number().int(), name: z.string(), tag: z.string().optional() });\r\nconst Pets = z.array(Pet);\r\nconst Error = z.object({ code: z.number().int(), message: z.string() });\r\n\r\nexport const schemas = {\r\n    Pet,\r\n    Pets,\r\n    Error,\r\n};\r\n\r\nconst endpoints = makeApi([\r\n    {\r\n        method: \"get\",\r\n        path: \"/pets\",\r\n        requestFormat: \"json\",\r\n        parameters: [\r\n            {\r\n                name: \"limit\",\r\n                type: \"Query\",\r\n                schema: z.number().int().optional(),\r\n            },\r\n        ],\r\n        response: z.array(Pet),\r\n    },\r\n    {\r\n        method: \"post\",\r\n        path: \"/pets\",\r\n        requestFormat: \"json\",\r\n        response: z.void(),\r\n    },\r\n    {\r\n        method: \"get\",\r\n        path: \"/pets/:petId\",\r\n        requestFormat: \"json\",\r\n        parameters: [\r\n            {\r\n                name: \"petId\",\r\n                type: \"Path\",\r\n                schema: z.string(),\r\n            },\r\n        ],\r\n        response: Pet,\r\n    },\r\n]);\r\n\r\nexport const api = new Zodios(endpoints);\r\n\r\nexport function createApiClient(baseUrl: string) {\r\n    return new Zodios(baseUrl, endpoints);\r\n}\r\n```\r\n\r\n# TODO\r\n\r\n-   handle OA `prefixItems` -> output `z.tuple`\r\n-   rm unused (=never referenced) variables from output\r\n\r\n# Caveats\r\n\r\nNOT tested/expected to work with OpenAPI before v3, please migrate your specs to v3+ if you want to use this\r\n\r\n## Contributing:\r\n\r\n-   `pnpm i && pnpm gen`\r\n\r\nif you fix an edge case please make a dedicated minimal reproduction test in the [`tests`](./tests) folder so that it doesn't break in future versions\r\n","readmeFilename":"README.md"}