fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1162 from hey-api/docs/zod-plugin

docs: add Zod plugin page

authored by

Lubos and committed by
GitHub
41e42590 2f88e9a2

+115 -84
+5
.changeset/new-apples-suffer.md
··· 1 + --- 2 + '@hey-api/docs': patch 3 + --- 4 + 5 + docs: add Zod plugin page
+1
README.md
··· 13 13 - supports both JSON and YAML input files 14 14 - generates TypeScript interfaces, REST clients, and JSON Schemas 15 15 - Fetch API, Axios, Angular, Node.js, and XHR clients available 16 + - plugin ecosystem to reduce third-party boilerplate 16 17 17 18 ## Documentation 18 19
+20 -5
docs/.vitepress/config/en.ts
··· 5 5 '🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.', 6 6 lang: 'en-US', 7 7 themeConfig: { 8 + nav: [ 9 + { 10 + link: 'https://github.com/sponsors/mrlubos', 11 + text: 'Sponsor Hey API', 12 + }, 13 + ], 8 14 sidebar: [ 9 15 { 10 16 items: [ ··· 36 42 text: 'Clients', 37 43 }, 38 44 { link: '/openapi-ts/transformers', text: 'Transformers' }, 39 - { link: '/openapi-ts/migrating', text: 'Migrating' }, 40 45 ], 41 46 text: 'Guides and Concepts', 42 47 }, 43 48 { 44 49 items: [ 45 50 { 46 - link: '/openapi-ts/integrations', 47 - text: 'Integrations <span class="soon">soon</span>', 51 + link: '/openapi-ts/tanstack-query', 52 + text: 'TanStack Query', 48 53 }, 49 54 { 50 - link: '/openapi-ts/tanstack-query', 51 - text: 'TanStack Query', 55 + link: '/openapi-ts/zod', 56 + text: 'Zod <span class="soon">soon</span>', 52 57 }, 53 58 ], 54 59 text: 'Plugins', 55 60 }, 56 61 { 57 62 items: [ 63 + { 64 + link: '/openapi-ts/integrations', 65 + text: 'GitHub <span class="soon">soon</span>', 66 + }, 67 + ], 68 + text: 'Integrations', 69 + }, 70 + { 71 + items: [ 58 72 { link: '/about', text: 'Philosophy' }, 59 73 { link: '/license', text: 'License' }, 60 74 { link: '/contributing', text: 'Contributing' }, 75 + { link: '/openapi-ts/migrating', text: 'Migrating' }, 61 76 ], 62 77 text: '@hey-api', 63 78 },
+11 -3
docs/about.md
··· 13 13 links: [ 14 14 { icon: 'github', link: 'https://github.com/ferdikoomen' }, 15 15 ], 16 - title: 'Author of OpenAPI TypeScript Codegen', 16 + title: 'OpenAPI TypeScript Codegen', 17 + }, 18 + { 19 + avatar: 'https://github.com/nicolas-chaulet.png', 20 + name: 'Nicolas Chaulet', 21 + links: [ 22 + { icon: 'github', link: 'https://github.com/nicolas-chaulet' }, 23 + ], 24 + title: 'Made the Hey API fork', 17 25 }, 18 26 { 19 27 avatar: 'https://github.com/jordanshatford.png', 20 - name: 'Jordan', 28 + name: 'Jordan Shatford', 21 29 links: [ 22 30 { icon: 'github', link: 'https://github.com/jordanshatford' }, 23 31 ], 24 - title: 'Maintainer', 32 + title: 'Maintainer and Contributor', 25 33 }, 26 34 ] 27 35 </script>
+9 -32
docs/contributing.md
··· 7 7 8 8 Thank you for considering contributing to Hey API. In order to increase the likelihood of your changes being merged, first open an issue if one does not already exist. Once an issue exists, let us know you'd like to work on it. We will confirm whether we're looking to resolve the issue and provide you with guidance if required. This is to ensure our codebase remains in good state and all features contribute to Hey API's [objectives](/about). 9 9 10 - ## Development Requirements 10 + ## Prerequisites 11 11 12 - - [git](https://git-scm.com/) 13 - - [node](https://nodejs.org/en) (version `18.0` or higher) 14 - - [pnpm](https://pnpm.io/) (version `8` or higher) 12 + You should have a working knowledge of [git](https://git-scm.com/), [node](https://nodejs.org/en), and [pnpm](https://pnpm.io/). 15 13 16 - ## Install Dependencies 14 + ## Guidelines 17 15 18 - We use pnpm as our package manager. You can setup and install all dependencies running the following command: 16 + Your [pull request](https://help.github.com/articles/using-pull-requests) must: 19 17 20 - ```sh 21 - pnpm install 22 - ``` 23 - 24 - ## Pull Request Guidelines 18 + - address a single issue or add a single item of functionality 19 + - contain a clean history of small, incremental, logically separate commits, with no merge commits 20 + - use clear commit messages 21 + - be possible to merge automatically 25 22 26 - If you are unfamiliar with GitHub Pull Requests, please read the following documentation: 27 - https://help.github.com/articles/using-pull-requests 28 - 29 - **Your Pull Request must:** 30 - 31 - - Address a single issue or add a single item of functionality. 32 - - Contain a clean history of small, incremental, logically separate commits, with no merge commits. 33 - - Use clear commit messages. 34 - - Be possible to merge automatically. 35 - 36 - ## Submitting a Pull Request 37 - 38 - 1. Make your changes in a new git branch: `git checkout -b my-fix-branch main` 39 - 1. Create your patch or feature 40 - 1. Ensure the builds work by running: `pnpm build` 41 - 1. Ensure the tests will pass by running: `pnpm test` 42 - 1. Ensure the code is formatted by running: `pnpm lint:fix` 43 - 1. Ensure that you create a changeset if required by running: `pnpm changeset` 44 - 1. Commit your changes using a descriptive commit message 45 - 46 - After your Pull Request is created, it will automatically be built and tested in GitHub actions. Once successful, it will be ready for review. 23 + <!--@include: ./sponsorship.md-->
+8 -8
docs/index.md
··· 3 3 4 4 hero: 5 5 name: High-quality tools for interacting with APIs 6 - tagline: Abstractions for your TypeScript code. Automate type generation and type-safe data fetching. 6 + tagline: Codegen for your TypeScript projects. Trusted more than 500k times each month to generate reliable API clients and SDKs. 7 7 actions: 8 8 - theme: brand 9 9 text: Get Started ··· 22 22 link: /openapi-ts/get-started 23 23 linkText: Get started 24 24 - icon: <svg fill="none" height="24" viewBox="0 0 128 128" width="24" xmlns="http://www.w3.org/2000/svg"><rect fill="#3178c6" height="128" rx="6" width="128"/><path clip-rule="evenodd" d="m74.2622 99.468v14.026c2.2724 1.168 4.9598 2.045 8.0625 2.629 3.1027.585 6.3728.877 9.8105.877 3.3503 0 6.533-.321 9.5478-.964 3.016-.643 5.659-1.702 7.932-3.178 2.272-1.476 4.071-3.404 5.397-5.786 1.325-2.381 1.988-5.325 1.988-8.8313 0-2.5421-.379-4.7701-1.136-6.6841-.758-1.9139-1.85-3.6159-3.278-5.1062-1.427-1.4902-3.139-2.827-5.134-4.0104-1.996-1.1834-4.246-2.3011-6.752-3.353-1.8352-.7597-3.4812-1.4975-4.9378-2.2134-1.4567-.7159-2.6948-1.4464-3.7144-2.1915-1.0197-.7452-1.8063-1.5341-2.3598-2.3669-.5535-.8327-.8303-1.7751-.8303-2.827 0-.9643.2476-1.8336.7429-2.6079s1.1945-1.4391 2.0976-1.9943c.9031-.5551 2.0101-.9861 3.3211-1.2929 1.311-.3069 2.7676-.4603 4.3699-.4603 1.1658 0 2.3958.0877 3.6928.263 1.296.1753 2.6.4456 3.911.8109 1.311.3652 2.585.8254 3.824 1.3806 1.238.5552 2.381 1.198 3.43 1.9285v-13.1051c-2.127-.8182-4.45-1.4245-6.97-1.819s-5.411-.5917-8.6744-.5917c-3.3211 0-6.4674.3579-9.439 1.0738-2.9715.7159-5.5862 1.8336-7.844 3.353-2.2578 1.5195-4.0422 3.4553-5.3531 5.8075-1.311 2.3522-1.9665 5.1646-1.9665 8.4373 0 4.1785 1.2017 7.7433 3.6052 10.6945 2.4035 2.9513 6.0523 5.4496 10.9466 7.495 1.9228.7889 3.7145 1.5633 5.375 2.323 1.6606.7597 3.0954 1.5486 4.3044 2.3668s2.1628 1.7094 2.8618 2.6736c.7.9643 1.049 2.06 1.049 3.2873 0 .9062-.218 1.7462-.655 2.5202s-1.1 1.446-1.9885 2.016c-.8886.57-1.9956 1.016-3.3212 1.337-1.3255.321-2.8768.482-4.6539.482-3.0299 0-6.0305-.533-9.0021-1.6-2.9715-1.066-5.7245-2.666-8.2591-4.799zm-23.5596-34.9136h18.2974v-11.5544h-51v11.5544h18.2079v51.4456h14.4947z" fill="#fff" fill-rule="evenodd"/></svg> 25 - title: TypeScript Interfaces 25 + title: Type Safety 26 26 details: Ensure code correctness without runtime overhead. No manual maintenance required. 27 27 link: /openapi-ts/output 28 28 linkText: Learn more ··· 36 36 details: Export OpenAPI schemas as JavaScript objects. JSON Schema 2020-12 supported. 37 37 link: /openapi-ts/output#json-schemas 38 38 linkText: Learn more 39 + - icon: <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 190 190"><g fill="none" fill-rule="evenodd"><path d="M150.276 61.344c3.093-14.981 3.756-26.471 1.757-34.815-1.189-4.962-3.362-9.01-6.668-11.93-3.49-3.084-7.901-4.597-12.858-4.597-8.178 0-16.775 3.725-25.963 10.802-3.747 2.887-7.636 6.366-11.676 10.44a8.743 8.743 0 0 0-1.09-1.163C82.36 19.915 72.746 13.599 64.523 11.164c-4.89-1.448-9.48-1.586-13.66-.181-4.414 1.483-7.93 4.55-10.41 8.845-4.094 7.089-5.174 16.403-3.648 27.904.623 4.688 1.686 9.794 3.189 15.327a8.725 8.725 0 0 0-1.698.38c-14.489 4.797-24.749 9.955-30.96 15.85-3.696 3.506-6.109 7.41-6.981 11.733-.921 4.562-.023 9.137 2.454 13.43 4.087 7.078 11.6 12.66 22.304 17.082 4.298 1.776 9.161 3.384 14.595 4.83a8.735 8.735 0 0 0-.57 1.776c-3.092 14.98-3.756 26.47-1.756 34.814 1.188 4.962 3.362 9.01 6.667 11.93 3.49 3.084 7.902 4.597 12.86 4.597 8.177 0 16.774-3.725 25.962-10.802 3.787-2.917 7.72-6.44 11.805-10.57.42.656.936 1.267 1.546 1.81 11.42 10.166 21.034 16.482 29.257 18.917 4.89 1.448 9.48 1.586 13.66.181 4.414-1.483 7.93-4.55 10.41-8.845 4.094-7.089 5.174-16.403 3.648-27.904-.645-4.857-1.764-10.164-3.354-15.929a8.715 8.715 0 0 0 1.863-.398c14.489-4.797 24.749-9.955 30.96-15.85 3.696-3.506 6.109-7.41 6.981-11.733.921-4.562.023-9.137-2.454-13.43-4.087-7.078-11.6-12.66-22.304-17.082-4.427-1.828-9.452-3.48-15.082-4.959.2-.49.36-1.006.47-1.543Z" fill="#002C4B" fill-rule="nonzero"/><path d="M80.397 64h29.211a5 5 0 0 1 4.337 2.512l14.632 25.5a5 5 0 0 1 0 4.976l-14.632 25.5a5 5 0 0 1-4.337 2.512H80.397a5 5 0 0 1-4.337-2.512l-14.632-25.5a5 5 0 0 1 0-4.976l14.632-25.5A5 5 0 0 1 80.397 64Zm25.59 6.277a5 5 0 0 1 4.339 2.513l11.017 19.224a5 5 0 0 1 0 4.972l-11.017 19.224a5 5 0 0 1-4.338 2.513h-21.97a5 5 0 0 1-4.339-2.513L68.662 96.986a5 5 0 0 1 0-4.972L79.679 72.79a5 5 0 0 1 4.338-2.513h21.97Zm-3.906 6.864H87.924a5 5 0 0 0-4.335 2.51l-7.1 12.358a5 5 0 0 0 0 4.982l7.1 12.358a5 5 0 0 0 4.335 2.51h14.157a5 5 0 0 0 4.335-2.51l7.1-12.358a5 5 0 0 0 0-4.982l-7.1-12.358a5 5 0 0 0-4.335-2.51Zm-3.762 6.571a5 5 0 0 1 4.334 2.506l3.33 5.788a5 5 0 0 1 0 4.988l-3.33 5.788a5 5 0 0 1-4.334 2.506h-6.633a5 5 0 0 1-4.334-2.506l-3.33-5.788a5 5 0 0 1 0-4.988l3.33-5.788a5 5 0 0 1 4.334-2.506h6.633Zm-3.315 6.473a4.313 4.313 0 1 0-.003 8.63 4.313 4.313 0 1 0 .003-8.63ZM60 94.5h7.768" fill="#FFD94C"/><path d="M54.86 108.358a2.713 2.713 0 0 1 3.718 1.041l.475.845a269.421 269.421 0 0 0 11.888 19.191c4.867 7.15 10.34 14.39 16.421 21.716a2.776 2.776 0 0 1-.296 3.847l-.612.537c-20.107 17.568-33.176 21.078-39.206 10.527-5.898-10.32-3.764-29.08 6.403-56.28a2.748 2.748 0 0 1 1.21-1.424Zm85.674 20.684a2.708 2.708 0 0 1 3.126 2.152l.153.792c4.97 26.01 1.47 39.014-10.497 39.014-11.706 0-26.607-11.091-44.703-33.273a2.725 2.725 0 0 1-.613-1.745 2.712 2.712 0 0 1 2.73-2.694l.955.007c7.62.041 15.03-.223 22.226-.794 8.498-.673 17.373-1.826 26.623-3.46Zm6.875-55.23c.523-1.41 2.1-2.149 3.546-1.663l.788.266c25.84 8.803 35.66 18.477 29.455 29.022-6.068 10.314-23.714 17.823-52.936 22.527a2.852 2.852 0 0 1-1.88-.345 2.726 2.726 0 0 1-.993-3.772l.5-.837c3.988-6.694 7.592-13.356 10.813-19.986 3.803-7.83 7.372-16.233 10.707-25.212Zm-85.67-7.776a2.852 2.852 0 0 1 1.878.345 2.726 2.726 0 0 1 .994 3.772l-.5.837c-3.988 6.694-7.592 13.356-10.813 19.986-3.803 7.83-7.372 16.233-10.707 25.212-.523 1.41-2.1 2.149-3.546 1.663l-.788-.266c-25.84-8.803-35.66-18.477-29.455-29.022C14.87 78.25 32.516 70.74 61.738 66.036Zm41.807-31.57c20.107-17.57 33.176-21.079 39.206-10.528 5.898 10.32 3.764 29.08-6.403 56.28a2.748 2.748 0 0 1-1.21 1.424 2.713 2.713 0 0 1-3.717-1.041l-.475-.845a269.421 269.421 0 0 0-11.888-19.191c-4.867-7.15-10.34-14.39-16.421-21.716a2.776 2.776 0 0 1 .296-3.847ZM57.684 18c11.706 0 26.607 11.091 44.703 33.273.402.492.618 1.11.613 1.745a2.712 2.712 0 0 1-2.73 2.694l-.955-.007c-7.62-.041-15.03.223-22.226.794-8.498.673-17.373 1.826-26.623 3.46a2.708 2.708 0 0 1-3.126-2.153l-.153-.792C42.217 31.004 45.717 18 57.684 18Z" fill="#FF4154"/></g></svg> 40 + title: Plugins 41 + details: Reduce third-party boilerplate with our plugin ecosystem. 42 + link: /openapi-ts/tanstack-query 43 + linkText: Learn more 39 44 - icon: <svg class="icon-github" width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg> 40 - title: GitHub Integration <span class="soon">Soon</span> 45 + title: Integrations <span class="soon">Soon</span> 41 46 details: Automatically update your code when the APIs it depends on change. Works with any codegen. 42 47 link: /openapi-ts/integrations 43 - linkText: Find out more 44 - - icon: <svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 190 190"><g fill="none" fill-rule="evenodd"><path d="M150.276 61.344c3.093-14.981 3.756-26.471 1.757-34.815-1.189-4.962-3.362-9.01-6.668-11.93-3.49-3.084-7.901-4.597-12.858-4.597-8.178 0-16.775 3.725-25.963 10.802-3.747 2.887-7.636 6.366-11.676 10.44a8.743 8.743 0 0 0-1.09-1.163C82.36 19.915 72.746 13.599 64.523 11.164c-4.89-1.448-9.48-1.586-13.66-.181-4.414 1.483-7.93 4.55-10.41 8.845-4.094 7.089-5.174 16.403-3.648 27.904.623 4.688 1.686 9.794 3.189 15.327a8.725 8.725 0 0 0-1.698.38c-14.489 4.797-24.749 9.955-30.96 15.85-3.696 3.506-6.109 7.41-6.981 11.733-.921 4.562-.023 9.137 2.454 13.43 4.087 7.078 11.6 12.66 22.304 17.082 4.298 1.776 9.161 3.384 14.595 4.83a8.735 8.735 0 0 0-.57 1.776c-3.092 14.98-3.756 26.47-1.756 34.814 1.188 4.962 3.362 9.01 6.667 11.93 3.49 3.084 7.902 4.597 12.86 4.597 8.177 0 16.774-3.725 25.962-10.802 3.787-2.917 7.72-6.44 11.805-10.57.42.656.936 1.267 1.546 1.81 11.42 10.166 21.034 16.482 29.257 18.917 4.89 1.448 9.48 1.586 13.66.181 4.414-1.483 7.93-4.55 10.41-8.845 4.094-7.089 5.174-16.403 3.648-27.904-.645-4.857-1.764-10.164-3.354-15.929a8.715 8.715 0 0 0 1.863-.398c14.489-4.797 24.749-9.955 30.96-15.85 3.696-3.506 6.109-7.41 6.981-11.733.921-4.562.023-9.137-2.454-13.43-4.087-7.078-11.6-12.66-22.304-17.082-4.427-1.828-9.452-3.48-15.082-4.959.2-.49.36-1.006.47-1.543Z" fill="#002C4B" fill-rule="nonzero"/><path d="M80.397 64h29.211a5 5 0 0 1 4.337 2.512l14.632 25.5a5 5 0 0 1 0 4.976l-14.632 25.5a5 5 0 0 1-4.337 2.512H80.397a5 5 0 0 1-4.337-2.512l-14.632-25.5a5 5 0 0 1 0-4.976l14.632-25.5A5 5 0 0 1 80.397 64Zm25.59 6.277a5 5 0 0 1 4.339 2.513l11.017 19.224a5 5 0 0 1 0 4.972l-11.017 19.224a5 5 0 0 1-4.338 2.513h-21.97a5 5 0 0 1-4.339-2.513L68.662 96.986a5 5 0 0 1 0-4.972L79.679 72.79a5 5 0 0 1 4.338-2.513h21.97Zm-3.906 6.864H87.924a5 5 0 0 0-4.335 2.51l-7.1 12.358a5 5 0 0 0 0 4.982l7.1 12.358a5 5 0 0 0 4.335 2.51h14.157a5 5 0 0 0 4.335-2.51l7.1-12.358a5 5 0 0 0 0-4.982l-7.1-12.358a5 5 0 0 0-4.335-2.51Zm-3.762 6.571a5 5 0 0 1 4.334 2.506l3.33 5.788a5 5 0 0 1 0 4.988l-3.33 5.788a5 5 0 0 1-4.334 2.506h-6.633a5 5 0 0 1-4.334-2.506l-3.33-5.788a5 5 0 0 1 0-4.988l3.33-5.788a5 5 0 0 1 4.334-2.506h6.633Zm-3.315 6.473a4.313 4.313 0 1 0-.003 8.63 4.313 4.313 0 1 0 .003-8.63ZM60 94.5h7.768" fill="#FFD94C"/><path d="M54.86 108.358a2.713 2.713 0 0 1 3.718 1.041l.475.845a269.421 269.421 0 0 0 11.888 19.191c4.867 7.15 10.34 14.39 16.421 21.716a2.776 2.776 0 0 1-.296 3.847l-.612.537c-20.107 17.568-33.176 21.078-39.206 10.527-5.898-10.32-3.764-29.08 6.403-56.28a2.748 2.748 0 0 1 1.21-1.424Zm85.674 20.684a2.708 2.708 0 0 1 3.126 2.152l.153.792c4.97 26.01 1.47 39.014-10.497 39.014-11.706 0-26.607-11.091-44.703-33.273a2.725 2.725 0 0 1-.613-1.745 2.712 2.712 0 0 1 2.73-2.694l.955.007c7.62.041 15.03-.223 22.226-.794 8.498-.673 17.373-1.826 26.623-3.46Zm6.875-55.23c.523-1.41 2.1-2.149 3.546-1.663l.788.266c25.84 8.803 35.66 18.477 29.455 29.022-6.068 10.314-23.714 17.823-52.936 22.527a2.852 2.852 0 0 1-1.88-.345 2.726 2.726 0 0 1-.993-3.772l.5-.837c3.988-6.694 7.592-13.356 10.813-19.986 3.803-7.83 7.372-16.233 10.707-25.212Zm-85.67-7.776a2.852 2.852 0 0 1 1.878.345 2.726 2.726 0 0 1 .994 3.772l-.5.837c-3.988 6.694-7.592 13.356-10.813 19.986-3.803 7.83-7.372 16.233-10.707 25.212-.523 1.41-2.1 2.149-3.546 1.663l-.788-.266c-25.84-8.803-35.66-18.477-29.455-29.022C14.87 78.25 32.516 70.74 61.738 66.036Zm41.807-31.57c20.107-17.57 33.176-21.079 39.206-10.528 5.898 10.32 3.764 29.08-6.403 56.28a2.748 2.748 0 0 1-1.21 1.424 2.713 2.713 0 0 1-3.717-1.041l-.475-.845a269.421 269.421 0 0 0-11.888-19.191c-4.867-7.15-10.34-14.39-16.421-21.716a2.776 2.776 0 0 1 .296-3.847ZM57.684 18c11.706 0 26.607 11.091 44.703 33.273.402.492.618 1.11.613 1.745a2.712 2.712 0 0 1-2.73 2.694l-.955-.007c-7.62-.041-15.03.223-22.226.794-8.498.673-17.373 1.826-26.623 3.46a2.708 2.708 0 0 1-3.126-2.153l-.153-.792C42.217 31.004 45.717 18 57.684 18Z" fill="#FF4154"/></g></svg> 45 - title: TanStack Query 46 - details: Generate query keys and functions. Use them with our REST clients or bring your own. 47 - link: /openapi-ts/tanstack-query 48 48 linkText: Find out more 49 49 --- 50 50
+3 -3
docs/openapi-ts/clients.md
··· 1 1 --- 2 2 title: Clients 3 - description: REST clients for your stack. Compatible with all our features. 3 + description: REST clients for Hey API. Compatible with all our features. 4 4 --- 5 5 6 6 <script setup> ··· 13 13 14 14 ## Features 15 15 16 - - seamless integration with `@hey-api/openapi-ts` 16 + - seamless integration with `@hey-api/openapi-ts` ecosystem 17 17 - type-safe response data and errors 18 18 - access to the original request and response 19 19 - granular request and response customization options ··· 27 27 - [Legacy](/openapi-ts/clients/legacy) 28 28 - [Next.js](https://nextjs.org/) <span class="soon">Soon</span> 29 29 30 - If you'd like a standalone package for your client, let us know by [opening an issue](https://github.com/hey-api/openapi-ts/issues). 30 + If you'd like Hey API to support your client, let us know by [opening an issue](https://github.com/hey-api/openapi-ts/issues). 31 31 32 32 <!--@include: ../examples.md--> 33 33 <!--@include: ../sponsorship.md-->
+3 -3
docs/openapi-ts/clients/axios.md
··· 1 1 --- 2 2 title: Axios client 3 - description: Axios client for your stack. Compatible with all our features. 3 + description: Axios client for Hey API. Compatible with all our features. 4 4 --- 5 5 6 6 <script setup> ··· 13 13 Axios client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues). 14 14 ::: 15 15 16 - Plug and play Axios wrapper for `@hey-api/openapi-ts` generator. 16 + [Axios](https://axios-http.com/) is a simple promise based HTTP client for the browser and Node.js. Axios provides a simple to use library in a small package with a very extensible interface. 17 17 18 18 <button class="buttonLink" @click="(event) => embedProject('hey-api-client-axios-example')(event)"> 19 19 Live demo ··· 142 142 143 143 ## Bundling 144 144 145 - Sometimes, you may not want to declare standalone clients as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option. 145 + Sometimes, you may not want to declare client packages as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option. 146 146 147 147 ```js 148 148 export default {
+3 -3
docs/openapi-ts/clients/fetch.md
··· 1 1 --- 2 2 title: Fetch API client 3 - description: Fetch API client for your stack. Compatible with all our features. 3 + description: Fetch API client for Hey API. Compatible with all our features. 4 4 --- 5 5 6 6 <script setup> ··· 13 13 Fetch API client is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues). 14 14 ::: 15 15 16 - Plug and play Fetch API wrapper for `@hey-api/openapi-ts` generator. 16 + The [Fetch API](https://developer.mozilla.org/docs/Web/API/Fetch_API) provides an interface for fetching resources (including across the network). It is a more powerful and flexible replacement for XMLHttpRequest. 17 17 18 18 <button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-example')(event)"> 19 19 Live demo ··· 181 181 182 182 ## Bundling 183 183 184 - Sometimes, you may not want to declare standalone clients as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option. 184 + Sometimes, you may not want to declare client packages as a dependency. This scenario is common if you're using Hey API to generate output that is repackaged and published for other consumers under your own brand. For such cases, our clients support bundling through the `client.bundle` configuration option. 185 185 186 186 ```js 187 187 export default {
+2 -2
docs/openapi-ts/clients/legacy.md
··· 1 1 --- 2 2 title: Legacy clients 3 - description: Legacy client for your stack. 3 + description: Legacy clients for Hey API. 4 4 --- 5 5 6 6 <script setup> ··· 9 9 10 10 # Legacy Clients 11 11 12 - Before standalone client packages, clients were generated using `@hey-api/openapi-ts`. In fact, `@hey-api/openapi-ts` still supports generating legacy clients. You can generate them with the `client` config option. 12 + Before client packages, clients were generated using `@hey-api/openapi-ts`. In fact, `@hey-api/openapi-ts` still supports generating legacy clients. You can generate them with the `client` config option. 13 13 14 14 ::: code-group 15 15
+6 -1
docs/openapi-ts/get-started.md
··· 9 9 10 10 # Get Started 11 11 12 - 🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. 12 + ::: warning 13 + This package is in initial development. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues). 14 + ::: 15 + 16 + [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an OpenAPI to TypeScript codegen trusted more than 500k times each month to generate reliable API clients and SDKs. 13 17 14 18 <button class="buttonLink" @click="(event) => embedProject('hey-api-example')(event)"> 15 19 Live demo ··· 22 26 - supports both JSON and YAML input files 23 27 - generates TypeScript interfaces, REST clients, and JSON Schemas 24 28 - Fetch API, Axios, Angular, Node.js, and XHR clients available 29 + - plugin ecosystem to reduce third-party boilerplate 25 30 26 31 ## Quick Start 27 32
+4
docs/openapi-ts/integrations.md
··· 5 5 6 6 # Integrations <span class="soon">Soon</span> 7 7 8 + ::: warning 9 + GitHub integration is not publicly available yet. We are gathering feedback from beta testers to ensure the final product meets our quality standards. To express your interest in joining the beta test, please open an issue on [GitHub](https://github.com/hey-api/upload-openapi-spec/issues). 10 + ::: 11 + 8 12 Integrations allow you to automate your client generation workflow. Create dependency links between your clients and APIs, and watch the magic unfold. While we prefer to use `@hey-api/openapi-ts` for generating clients, you can use any codegen. 9 13 10 14 ## Upload OpenAPI Spec
+3 -3
docs/openapi-ts/migrating.md
··· 5 5 6 6 # Migrating 7 7 8 - While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into an issue with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues). 8 + While we try to avoid breaking changes, sometimes it's unavoidable in order to offer you the latest features. This page lists changes that require updates to your code. If you run into a problem with migration, please [open an issue](https://github.com/hey-api/openapi-ts/issues). 9 9 10 10 ## @next 11 11 ··· 123 123 124 124 ### Removed internal `client` export 125 125 126 - Previously, standalone clients would create a default client which you'd then import and configure. 126 + Previously, client packages would create a default client which you'd then import and configure. 127 127 128 128 ```js 129 129 import { client, createClient } from '@hey-api/client-fetch'; ··· 137 137 138 138 This client instance was used internally by services unless overridden. Apart from running `createClient()` twice, people were confused about the meaning of `global` configuration option. 139 139 140 - Starting with v0.52.0, standalone clients will not create a default client. Instead, services will define their own client. You can now achieve the same configuration by importing `client` from services and using the new `setConfig()` method. 140 + Starting with v0.52.0, client packages will not create a default client. Instead, services will define their own client. You can now achieve the same configuration by importing `client` from services and using the new `setConfig()` method. 141 141 142 142 ```js 143 143 import { client } from 'client/services.gen';
+1 -1
docs/openapi-ts/output.md
··· 250 250 251 251 ## Core 252 252 253 - Client core files are located in the `core` folder. This folder will include different files depending on which client you're using. With standalone packages, this folder isn't generated by default. If you want to bundle standalone clients into your output, read the [Bundling](/openapi-ts/clients#bundling) section. 253 + Client core files are located in the `core` folder. This folder will include different files depending on which client you're using. With client packages, this folder isn't generated by default. If you want to bundle client packages into your output, read the [Bundling](/openapi-ts/clients#bundling) section. 254 254 255 255 For legacy clients, the [`OpenAPI`](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/templates/core/OpenAPI.hbs#L68-L84) configuration object will be most likely of interest. You can change its properties to set authorization tokens, base URL, and more. 256 256
+9 -2
docs/openapi-ts/tanstack-query.md
··· 1 1 --- 2 2 title: TanStack Query 3 - description: Generate query keys and functions. Use them with our REST clients or bring your own. 3 + description: TanStack Query plugin for Hey API. Compatible with all our features. 4 4 --- 5 5 6 6 <script setup> ··· 13 13 TanStack Query plugin is currently in beta. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues). 14 14 ::: 15 15 16 - [TanStack Query](https://tanstack.com/query) is one of the most popular state management solutions. Hey API can generate query keys and functions for you, so you can focus on building your product. Everything is compatible with our REST clients, but you can bring your own too. 16 + [TanStack Query](https://tanstack.com/query) is a powerful asynchronous state management solution for TypeScript/JavaScript, React, Solid, Vue, Svelte, and Angular. 17 17 18 18 <button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-tanstack-react-query-example')(event)"> 19 19 Live demo 20 20 </button> 21 + 22 + ## Features 23 + 24 + - seamless integration with `@hey-api/openapi-ts` ecosystem 25 + - create query keys following the best practices 26 + - type-safe query options, infinite query options, and mutation options 27 + - minimal learning curve thanks to extending the underlying technology 21 28 22 29 ## Installation 23 30
+12
docs/openapi-ts/zod.md
··· 1 + --- 2 + title: Zod 3 + description: Zod plugin for Hey API. Compatible with all our features. 4 + --- 5 + 6 + # Zod 7 + 8 + ::: warning 9 + Zod plugin is in development. You can follow the updates and provide feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues/876). 10 + ::: 11 + 12 + [Zod](https://zod.dev/) is a TypeScript-first schema validation library with static type inference.
+2 -4
packages/client-axios/README.md
··· 1 1 <div align="center"> 2 2 <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 3 3 <h1 align="center"><b>Axios Client</b></h1> 4 - <p align="center">🚀 Type-safe Axios client for your Hey API types.</p> 4 + <p align="center">🚀 Axios client for `@hey-api/openapi-ts` codegen.</p> 5 5 </div> 6 - 7 - Plug and play Axios wrapper for `@hey-api/openapi-ts` generator. 8 6 9 7 [Live demo](https://stackblitz.com/edit/hey-api-client-axios-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fservices.gen.ts,src%2Fclient%2Ftypes.gen.ts,src%2FApp.tsx) 10 8 11 9 ## Features 12 10 13 - - seamless integration with `@hey-api/openapi-ts` 11 + - seamless integration with `@hey-api/openapi-ts` ecosystem 14 12 - type-safe response data and errors 15 13 - access to the original request and response 16 14 - granular request and response customization options
+1 -1
packages/client-axios/package.json
··· 1 1 { 2 2 "name": "@hey-api/client-axios", 3 3 "version": "0.2.9", 4 - "description": "Type-safe Axios client for your @hey-api/openapi-ts types", 4 + "description": "🚀 Axios client for `@hey-api/openapi-ts` codegen.", 5 5 "homepage": "https://heyapi.dev/", 6 6 "repository": { 7 7 "type": "git",
+2 -4
packages/client-fetch/README.md
··· 1 1 <div align="center"> 2 2 <img width="150" height="150" src="https://heyapi.dev/logo.png" alt="Logo"> 3 3 <h1 align="center"><b>Fetch API Client</b></h1> 4 - <p align="center">🚀 Type-safe Fetch API client for your Hey API types.</p> 4 + <p align="center">🚀 Fetch API client for `@hey-api/openapi-ts` codegen.</p> 5 5 </div> 6 - 7 - Plug and play Fetch API wrapper for `@hey-api/openapi-ts` generator. 8 6 9 7 [Live demo](https://stackblitz.com/edit/hey-api-client-fetch-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fservices.gen.ts,src%2Fclient%2Ftypes.gen.ts,src%2FApp.tsx) 10 8 11 9 ## Features 12 10 13 - - seamless integration with `@hey-api/openapi-ts` 11 + - seamless integration with `@hey-api/openapi-ts` ecosystem 14 12 - type-safe response data and errors 15 13 - access to the original request and response 16 14 - granular request and response customization options
+1 -1
packages/client-fetch/package.json
··· 1 1 { 2 2 "name": "@hey-api/client-fetch", 3 3 "version": "0.4.2", 4 - "description": "Type-safe Fetch API client for your @hey-api/openapi-ts types", 4 + "description": "🚀 Fetch API client for `@hey-api/openapi-ts` codegen.", 5 5 "homepage": "https://heyapi.dev/", 6 6 "repository": { 7 7 "type": "git",
+1
packages/openapi-ts/README.md
··· 13 13 - supports both JSON and YAML input files 14 14 - generates TypeScript interfaces, REST clients, and JSON Schemas 15 15 - Fetch API, Axios, Angular, Node.js, and XHR clients available 16 + - plugin ecosystem to reduce third-party boilerplate 16 17 17 18 ## Documentation 18 19
+4 -4
packages/openapi-ts/src/generate/client.ts
··· 24 24 export const clientOptionsTypeName = () => 'Options'; 25 25 26 26 /** 27 - * (optional) Creates a `client.ts` file containing the same exports as a 28 - * standalone client package. Creates a `client` directory containing the modules 29 - * from standalone client. These files are generated only when `client.bundle` 30 - * is set to true. 27 + * (optional) Creates a `client.ts` file containing the same exports as the 28 + * client package. Creates a `client` directory containing the modules from 29 + * the client package. These files are generated only when `client.bundle` is 30 + * set to true. 31 31 */ 32 32 export const generateClient = async ( 33 33 outputPath: string,
+3 -3
packages/openapi-ts/src/types/config.ts
··· 29 29 | false 30 30 | { 31 31 /** 32 - * Bundle the client module? Set this to true if you're using a standalone 33 - * client package and don't want to declare it as a separate dependency. 34 - * When true, the client module will be generated from the standalone 32 + * Bundle the client module? Set this to true if you're using a client 33 + * package and don't want to declare it as a separate dependency. 34 + * When true, the client module will be generated from the client 35 35 * package and bundled with the rest of the generated output. This is 36 36 * useful if you're repackaging the output, publishing it to other users, 37 37 * and you don't want them to install any dependencies.
+1 -1
packages/openapi-ts/src/utils/type.ts
··· 158 158 ? escapeName(unescapeName(transformTypeKeyName(property.name))) 159 159 : // special test for 1XX status codes. We need a more robust system 160 160 // for escaping values depending on context in which they're printed, 161 - // but since this works for standalone client, it's not worth it right now 161 + // but since this works for client packages, it's not worth it right now 162 162 /^\dXX$/.test(property.name) 163 163 ? escapeName(property.name) 164 164 : property.name;