{"_id":"@alexop/openapi-zod-client","_rev":"3-004fd06ab2b9b764f37397a0151e3e53","name":"@alexop/openapi-zod-client","dist-tags":{"latest":"1.11.2"},"versions":{"1.10.1":{"name":"@alexop/openapi-zod-client","version":"1.10.1","repository":{"type":"git","url":"git+https://github.com/alexop1000/openapi-zod-client.git"},"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"main":"dist/openapi-zod-client.cjs.js","module":"dist/openapi-zod-client.esm.js","homepage":"https://github.com/alexop1000/openapi-zod-client","bin":{"openapi-zod-client":"bin.js"},"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"},"license":"ISC","dependencies":{"@apidevtools/swagger-parser":"^10.1.0","@liuli-util/fs-extra":"^0.1.0","@zodios/core":"^10.3.1","axios":"^0.27.2","cac":"^6.7.14","handlebars":"^4.7.7","openapi-types":"^12.0.2","openapi3-ts":"3.1.0","pastable":"^2.0.13","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"},"gitHead":"eb80078fd5508349d4f669543e19fd1fa16cafa4","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/alexop1000/openapi-zod-client/issues"},"_id":"@alexop/openapi-zod-client@1.10.1","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-o8wHgvWnK12J6ui9z65AbIp+Lbkx1ngIEeS/wDh9uPbIxk0iZ8+9Y8eqWEOkQx2Estmwgoh1YGlhVmrxQqv8QQ==","shasum":"308ab16e1fd649572565f77d8eb463ab233ee672","tarball":"https://registry.npmjs.org/@alexop/openapi-zod-client/-/openapi-zod-client-1.10.1.tgz","fileCount":38,"unpackedSize":334651,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGDxNASmIbFJr+Xz5psKWCZpDeAgK6Io+l1uhDdgKx7jAiEAuH/ZQE7aTw9RlDKiXQMy20fxPZJc/NrnkpmAokcW6AQ="}]},"_npmUser":{"name":"alexop","email":"alexop1000@gmail.com"},"directories":{},"maintainers":[{"name":"alexop","email":"alexop1000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapi-zod-client_1.10.1_1690626505213_0.5790182879006724"},"_hasShrinkwrap":false},"1.10.2":{"name":"@alexop/openapi-zod-client","version":"1.10.2","repository":{"type":"git","url":"git+https://github.com/alexop1000/openapi-zod-client.git"},"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"main":"dist/alexop-openapi-zod-client.cjs.js","module":"dist/alexop-openapi-zod-client.esm.js","homepage":"https://github.com/alexop1000/openapi-zod-client","bin":{"openapi-zod-client":"bin.js"},"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"},"license":"ISC","dependencies":{"@apidevtools/swagger-parser":"^10.1.0","@liuli-util/fs-extra":"^0.1.0","@zodios/core":"^10.3.1","axios":"^0.27.2","cac":"^6.7.14","handlebars":"^4.7.7","openapi-types":"^12.0.2","openapi3-ts":"3.1.0","pastable":"^2.0.13","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"},"gitHead":"f5b570d1b0f43592dd0e0363b9bd8be2f14935c4","types":"./dist/alexop-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/alexop1000/openapi-zod-client/issues"},"_id":"@alexop/openapi-zod-client@1.10.2","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-LosRS31v/5gZ4AnVefitQtYzHe6TGb6AGBiBBywyWT2WpXWFaZoog1bTDtky+FqB3uNVetaEv3R9S4t9FDIzhA==","shasum":"4f67e797e935fef0a638bd78279d9c4c2627e5a8","tarball":"https://registry.npmjs.org/@alexop/openapi-zod-client/-/openapi-zod-client-1.10.2.tgz","fileCount":58,"unpackedSize":661496,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCW0txtkH6OvTJuNEXPTmnisHxVEfLz4qPZkxM9utSe9wIhAPm7qWxhXgGgxXzkorNOnGXJd/5+PclZ7gFl432P+39w"}]},"_npmUser":{"name":"alexop","email":"alexop1000@gmail.com"},"directories":{},"maintainers":[{"name":"alexop","email":"alexop1000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapi-zod-client_1.10.2_1690626941372_0.7889022745219199"},"_hasShrinkwrap":false},"1.11.1":{"name":"@alexop/openapi-zod-client","version":"1.11.1","repository":{"type":"git","url":"git+https://github.com/alexop1000/openapi-zod-client.git"},"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"main":"dist/openapi-zod-client.cjs.js","module":"dist/openapi-zod-client.esm.js","homepage":"https://github.com/alexop1000/openapi-zod-client","bin":{"openapi-zod-client":"bin.js"},"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"},"license":"ISC","dependencies":{"@apidevtools/swagger-parser":"^10.1.0","@liuli-util/fs-extra":"^0.1.0","@zodios/core":"^10.3.1","axios":"^0.27.2","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"},"_id":"@alexop/openapi-zod-client@1.11.1","gitHead":"78956f10574e8cfb0a502892e3ff53ef19cdb85f","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/alexop1000/openapi-zod-client/issues"},"_nodeVersion":"20.6.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-H5xrRfrZvakZXplX2ifnefWRnAbB9GXMosF297bmlZS25heB67Cta0PzHf/boeBmn+0tz1B5zEVyi4PQpCUCOA==","shasum":"64a4cc70f7e7597c4de3918dda058c8763d0561c","tarball":"https://registry.npmjs.org/@alexop/openapi-zod-client/-/openapi-zod-client-1.11.1.tgz","fileCount":58,"unpackedSize":700061,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAPsa03sB0kG+/7enLey2iB3G2cYx6y8zs+1x2EqZYkQIhAM9udFZXGjTmAgnfKchazbGSAqt3ROtYv3aCe6/0CZVD"}]},"_npmUser":{"name":"alexop","email":"alexop1000@gmail.com"},"directories":{},"maintainers":[{"name":"alexop","email":"alexop1000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapi-zod-client_1.11.1_1694885031201_0.48384374699496724"},"_hasShrinkwrap":false},"1.11.2":{"name":"@alexop/openapi-zod-client","version":"1.11.2","repository":{"type":"git","url":"git+https://github.com/alexop1000/openapi-zod-client.git"},"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"main":"dist/alexop-openapi-zod-client.cjs.js","module":"dist/alexop-openapi-zod-client.esm.js","homepage":"https://github.com/alexop1000/openapi-zod-client","bin":{"openapi-zod-client":"bin.js"},"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"},"license":"ISC","dependencies":{"@apidevtools/swagger-parser":"^10.1.0","@liuli-util/fs-extra":"^0.1.0","@zodios/core":"^10.3.1","axios":"^0.27.2","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"},"_id":"@alexop/openapi-zod-client@1.11.2","gitHead":"b4f95c08ff3349f36df26ad67e1821b28178ce0e","types":"./dist/alexop-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/alexop1000/openapi-zod-client/issues"},"_nodeVersion":"20.6.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-+kB0Y9JnsUMs9J3WPEww6NO9cSYi1Cq3SrvAIpOyBCqn9SoA95TGMVYDoFnWjt3EcYnr/UyieREOuUIk9kJoqQ==","shasum":"f22109a02351e3757152e8ce96ea865579f38df3","tarball":"https://registry.npmjs.org/@alexop/openapi-zod-client/-/openapi-zod-client-1.11.2.tgz","fileCount":58,"unpackedSize":700356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpoUqXRBnkTysfrWj/tIzcplnF0UEaEW9kFoQloBqFWAIhAIyXu1DDFfW9QWe2ScPDG3r/5a8blZ6V72AW/ryTe/v0"}]},"_npmUser":{"name":"alexop","email":"alexop1000@gmail.com"},"directories":{},"maintainers":[{"name":"alexop","email":"alexop1000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/openapi-zod-client_1.11.2_1694886371756_0.2752226313350341"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-29T10:28:25.141Z","1.10.1":"2023-07-29T10:28:25.400Z","modified":"2023-09-16T17:46:12.179Z","1.10.2":"2023-07-29T10:35:41.542Z","1.11.1":"2023-09-16T17:23:51.430Z","1.11.2":"2023-09-16T17:46:11.929Z"},"maintainers":[{"name":"alexop","email":"alexop1000@gmail.com"}],"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/)","homepage":"https://github.com/alexop1000/openapi-zod-client","keywords":["openapi","swagger","zod","client","zodios","generator","typescript"],"repository":{"type":"git","url":"git+https://github.com/alexop1000/openapi-zod-client.git"},"author":{"name":"Alexandre Stahmer","email":"alexandre.stahmer@gmail.com"},"bugs":{"url":"https://github.com/alexop1000/openapi-zod-client/issues"},"license":"ISC","readme":"# openapi-zod-client\n\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/)\n\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 !)**\n\n-   can be used programmatically _(do w/e you want with the computed schemas/endpoints)_\n-   or used as a CLI _(generates a prettier .ts file with deduplicated variables when pointing to the same schema/$ref)_\n\n-   client typesafety using [zodios](https://github.com/ecyrbe/zodios)\n-   tested (using [vitest](https://vitest.dev/)) against official [OpenAPI specs samples](https://github.com/OAI/OpenAPI-Specification/tree/main/schemas)\n\n# Why this exists\n\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 😇\n\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\n\n## Comparison vs tRPC etc\n\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\n\n# Usage\n\nwith local install:\n\n-   `pnpm i -D openapi-zod-client`\n-   `pnpm openapi-zod-client \"./input/file.json\" -o \"./output/client.ts\"`\n\nor directly (no install)\n\n-   `pnpx openapi-zod-client \"./input/file.yaml\" -o \"./output/client.ts\"`\n\n# auto-generated doc\n\nhttps://paka.dev/npm/openapi-zod-client\n\n## CLI\n\n```sh\nopenapi-zod-client/1.4.2\n\nUsage:\n  $ openapi-zod-client <input>\n\nCommands:\n  <input>  path/url to OpenAPI/Swagger document as json/yaml\n\nFor more info, run any command with the `--help` flag:\n  $ openapi-zod-client --help\n\nOptions:\n  -o, --output <path>       Output path for the zodios api client ts file (defaults to `<input>.client.ts`)\n  -t, --template <path>     Template path for the handlebars template that will be used to generate the output\n  -p, --prettier <path>     Prettier config path that will be used to format the output client file\n  -b, --base-url <url>      Base url for the api\n  -a, --with-alias          With alias as api client methods\n  --error-expr <expr>       Pass an expression to determine if a response status is an error\n  --success-expr <expr>     Pass an expression to determine which response status is the main success status\n  --media-type-expr <expr>  Pass an expression to determine which response content should be allowed\n  --export-schemas          When true, will export all `#/components/schemas`\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\n  --with-deprecated         when true, will keep deprecated endpoints in the api output\n  --group-strategy          groups endpoints by a given strategy, possible values are: 'none' | 'tag' | 'method' | 'tag-file' | 'method-file'\n  --complexity-threshold    schema complexity threshold to determine which one (using less than `<` operator) should be assigned to a variable\n  --default-status          when defined as `auto-correct`, will automatically use `default` as fallback for `response` when no status code was declared\n  -v, --version             Display version number\n  -h, --help                Display this message\n```\n\n## Customization\n\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:\n\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)\n\n## When using the CLI\n\n-   `--success-expr` is bound to [`isMainResponseStatus`](https://github.com/astahmer/openapi-zod-client/blob/b7717b53023728d077ceb2f451e4787f32945b3d/src/generateZodClientFromOpenAPI.ts#L234-L244)\n-   `--error-expr` is bound to [`isErrorStatus`](https://github.com/astahmer/openapi-zod-client/blob/b7717b53023728d077ceb2f451e4787f32945b3d/src/generateZodClientFromOpenAPI.ts#L245-L256)\n\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.\n\nExemple: `--success-expr \"status >= 200 && status < 300\"`\n\n## Tips\n\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\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:\n    `pnpx openapi-zod-client https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml -o ./petstore.ts`\n\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\n\n## Example\n\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)\n-   there's also [an example of a programmatic usage](./examples/basic/petstore-generator.ts)\n-   or you can check the tests in the `src` folder which are mostly just inline snapshots of the outputs\n\n# tl;dr\n\n[input](./samples/v3.0/petstore.yaml):\n\n```yaml\nopenapi: \"3.0.0\"\ninfo:\n    version: 1.0.0\n    title: Swagger Petstore\n    license:\n        name: MIT\nservers:\n    - url: http://petstore.swagger.io/v1\npaths:\n    /pets:\n        get:\n            summary: List all pets\n            operationId: listPets\n            tags:\n                - pets\n            parameters:\n                - name: limit\n                  in: query\n                  description: How many items to return at one time (max 100)\n                  required: false\n                  schema:\n                      type: integer\n                      format: int32\n            responses:\n                \"200\":\n                    description: A paged array of pets\n                    headers:\n                        x-next:\n                            description: A link to the next page of responses\n                            schema:\n                                type: string\n                    content:\n                        application/json:\n                            schema:\n                                $ref: \"#/components/schemas/Pets\"\n                default:\n                    description: unexpected error\n                    content:\n                        application/json:\n                            schema:\n                                $ref: \"#/components/schemas/Error\"\n        post:\n            summary: Create a pet\n            operationId: createPets\n            tags:\n                - pets\n            responses:\n                \"201\":\n                    description: Null response\n                default:\n                    description: unexpected error\n                    content:\n                        application/json:\n                            schema:\n                                $ref: \"#/components/schemas/Error\"\n    /pets/{petId}:\n        get:\n            summary: Info for a specific pet\n            operationId: showPetById\n            tags:\n                - pets\n            parameters:\n                - name: petId\n                  in: path\n                  required: true\n                  description: The id of the pet to retrieve\n                  schema:\n                      type: string\n            responses:\n                \"200\":\n                    description: Expected response to a valid request\n                    content:\n                        application/json:\n                            schema:\n                                $ref: \"#/components/schemas/Pet\"\n                default:\n                    description: unexpected error\n                    content:\n                        application/json:\n                            schema:\n                                $ref: \"#/components/schemas/Error\"\ncomponents:\n    schemas:\n        Pet:\n            type: object\n            required:\n                - id\n                - name\n            properties:\n                id:\n                    type: integer\n                    format: int64\n                name:\n                    type: string\n                tag:\n                    type: string\n        Pets:\n            type: array\n            items:\n                $ref: \"#/components/schemas/Pet\"\n        Error:\n            type: object\n            required:\n                - code\n                - message\n            properties:\n                code:\n                    type: integer\n                    format: int32\n                message:\n                    type: string\n```\n\noutput:\n\n```ts\nimport { makeApi, Zodios } from \"@zodios/core\";\nimport { z } from \"zod\";\n\nconst Pet = z.object({ id: z.number().int(), name: z.string(), tag: z.string().optional() });\nconst Pets = z.array(Pet);\nconst Error = z.object({ code: z.number().int(), message: z.string() });\n\nexport const schemas = {\n    Pet,\n    Pets,\n    Error,\n};\n\nconst endpoints = makeApi([\n    {\n        method: \"get\",\n        path: \"/pets\",\n        requestFormat: \"json\",\n        parameters: [\n            {\n                name: \"limit\",\n                type: \"Query\",\n                schema: z.number().int().optional(),\n            },\n        ],\n        response: z.array(Pet),\n    },\n    {\n        method: \"post\",\n        path: \"/pets\",\n        requestFormat: \"json\",\n        response: z.void(),\n    },\n    {\n        method: \"get\",\n        path: \"/pets/:petId\",\n        requestFormat: \"json\",\n        parameters: [\n            {\n                name: \"petId\",\n                type: \"Path\",\n                schema: z.string(),\n            },\n        ],\n        response: Pet,\n    },\n]);\n\nexport const api = new Zodios(endpoints);\n\nexport function createApiClient(baseUrl: string) {\n    return new Zodios(baseUrl, endpoints);\n}\n```\n\n# TODO\n\n-   handle OA `prefixItems` -> output `z.tuple`\n-   rm unused (=never referenced) variables from output\n\n# Caveats\n\nNOT tested/expected to work with OpenAPI before v3, please migrate your specs to v3+ if you want to use this\n\n## Contributing:\n\n-   `pnpm i && pnpm gen`\n\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\n","readmeFilename":"README.md"}