├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── deploy-doc.yaml │ └── tests.yaml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .lintstagedrc.json ├── .node-version ├── .npmignore ├── .nvmrc ├── .prettierignore ├── .prettierrc.json ├── .release-it.json ├── .vscode └── settings.json ├── .yarnrc.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEBUGGING.md ├── LICENSE ├── README.md ├── commitlint.config.js ├── docs ├── .gitignore ├── README.md ├── jsconfig.json ├── next.config.js ├── package.json ├── postcss.config.js ├── public │ ├── images │ │ ├── emblem.svg │ │ ├── favicon.svg │ │ ├── og-image.png │ │ └── orval-logo-horizontal.svg │ ├── robots.txt │ └── sitemap.xml ├── scripts │ └── build-sitemap.js ├── src │ ├── components │ │ ├── ArrowRight.js │ │ ├── Banner.js │ │ ├── CodeBlock.js │ │ ├── Container.js │ │ ├── DocsPageFooter.js │ │ ├── ExternalLink.js │ │ ├── Footer.js │ │ ├── Highlight.js │ │ ├── Highlight2.js │ │ ├── LayoutDocs.js │ │ ├── LazyImage.js │ │ ├── Logo.js │ │ ├── MDXComponents.js │ │ ├── Markdown.js │ │ ├── Nav.js │ │ ├── ProgressiveImage.js │ │ ├── Search.js │ │ ├── Seo.js │ │ ├── Sidebar.js │ │ ├── SidebarCategory.js │ │ ├── SidebarHeading.js │ │ ├── SidebarMobile.js │ │ ├── SidebarNavLink.js │ │ ├── SidebarPost.js │ │ ├── Sticky.js │ │ ├── TWButton.js │ │ ├── Toc.js │ │ ├── Toc.module.css │ │ ├── TocNotion.js │ │ ├── blog-markdown.module.css │ │ ├── blog │ │ │ ├── ExternalLink.js │ │ │ ├── Heading.js │ │ │ ├── Image.js │ │ │ ├── dynamic.js │ │ │ └── intersection-observer │ │ │ │ ├── index.js │ │ │ │ ├── intersection-observer.js │ │ │ │ ├── manager.js │ │ │ │ └── utils.js │ │ ├── clients │ │ │ ├── Client.js │ │ │ ├── ClientsMarquee.js │ │ │ └── Filters.js │ │ ├── forwardRefWithAs.js │ │ ├── markdown.module.css │ │ ├── playground │ │ │ ├── CodegenOutput.js │ │ │ ├── Editor.js │ │ │ ├── Examples.js │ │ │ ├── Playground.js │ │ │ └── PlaygroundEditors.js │ │ ├── useClipboard.js │ │ ├── useIsMobile.js │ │ ├── useOverScroll.js │ │ ├── useSearch.js │ │ ├── useTocHighlight.js │ │ └── utils │ │ │ └── throttle.js │ ├── get-sponsors.js │ ├── lib │ │ ├── docs │ │ │ ├── findRouteByPath.js │ │ │ ├── md-loader.js │ │ │ ├── remark-paragraph-alerts.js │ │ │ ├── remark-plugins.js │ │ │ └── utils.js │ │ ├── fs-utils.js │ │ └── get-route-context.js │ ├── manifests │ │ ├── getManifest.js │ │ └── manifest.json │ ├── pages │ │ ├── 404.js │ │ ├── _app.js │ │ ├── _document.js │ │ ├── api │ │ │ └── generate.js │ │ ├── guides │ │ │ ├── angular.md │ │ │ ├── basics.md │ │ │ ├── client-with-zod.md │ │ │ ├── custom-axios.md │ │ │ ├── custom-client.md │ │ │ ├── enums.md │ │ │ ├── fetch-client.md │ │ │ ├── fetch.md │ │ │ ├── hono.md │ │ │ ├── mcp.md │ │ │ ├── msw.md │ │ │ ├── react-query.md │ │ │ ├── set-base-url.md │ │ │ ├── svelte-query.md │ │ │ ├── swr.md │ │ │ ├── vue-query.md │ │ │ └── zod.md │ │ ├── index.js │ │ ├── installation.md │ │ ├── overview.md │ │ ├── playground.js │ │ ├── quick-start.md │ │ └── reference │ │ │ ├── cli.md │ │ │ ├── configuration │ │ │ ├── full-example.md │ │ │ ├── hooks.md │ │ │ ├── input.md │ │ │ ├── output.md │ │ │ └── overview.md │ │ │ └── integration.md │ ├── siteConfig.js │ ├── styles │ │ ├── blog.module.css │ │ ├── index.css │ │ ├── post.module.css │ │ └── shared.module.css │ └── users.js ├── tailwind.config.js ├── vercel.json └── yarn.lock ├── eslint.config.mjs ├── logo └── orval-logo-horizontal.svg ├── package.json ├── packages ├── angular │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── axios │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── core │ ├── README.md │ ├── package.json │ ├── src │ │ ├── constants.ts │ │ ├── generators │ │ │ ├── component-definition.ts │ │ │ ├── imports.ts │ │ │ ├── index.ts │ │ │ ├── interface.test.ts │ │ │ ├── interface.ts │ │ │ ├── models-inline.ts │ │ │ ├── mutator.ts │ │ │ ├── options.ts │ │ │ ├── parameter-definition.test.ts │ │ │ ├── parameter-definition.ts │ │ │ ├── schema-definition.test.ts │ │ │ ├── schema-definition.ts │ │ │ ├── verbs-options.test.ts │ │ │ └── verbs-options.ts │ │ ├── getters │ │ │ ├── array.ts │ │ │ ├── body.ts │ │ │ ├── combine.ts │ │ │ ├── discriminators.ts │ │ │ ├── enum.ts │ │ │ ├── index.ts │ │ │ ├── keys.ts │ │ │ ├── object.ts │ │ │ ├── operation.test.ts │ │ │ ├── operation.ts │ │ │ ├── parameters.ts │ │ │ ├── params.ts │ │ │ ├── props.ts │ │ │ ├── query-params.test.ts │ │ │ ├── query-params.ts │ │ │ ├── ref.ts │ │ │ ├── res-req-types.test.ts │ │ │ ├── res-req-types.ts │ │ │ ├── response.ts │ │ │ ├── route.test.ts │ │ │ ├── route.ts │ │ │ └── scalar.ts │ │ ├── index.ts │ │ ├── resolvers │ │ │ ├── index.ts │ │ │ ├── object.ts │ │ │ ├── ref.ts │ │ │ └── value.ts │ │ ├── types.ts │ │ ├── utils │ │ │ ├── assertion.test.ts │ │ │ ├── assertion.ts │ │ │ ├── async-reduce.ts │ │ │ ├── case.test.ts │ │ │ ├── case.ts │ │ │ ├── compare-version.ts │ │ │ ├── debug.ts │ │ │ ├── doc.ts │ │ │ ├── dynamic-import.ts │ │ │ ├── extension.ts │ │ │ ├── file.ts │ │ │ ├── fileExtensions.ts │ │ │ ├── index.ts │ │ │ ├── is-body-verb.ts │ │ │ ├── logger.ts │ │ │ ├── merge-deep.ts │ │ │ ├── occurrence.ts │ │ │ ├── open-api-converter.ts │ │ │ ├── path.ts │ │ │ ├── sort.ts │ │ │ ├── string.ts │ │ │ ├── tsconfig.ts │ │ │ └── validator.ts │ │ └── writers │ │ │ ├── generate-imports-for-builder.ts │ │ │ ├── index.ts │ │ │ ├── schemas.ts │ │ │ ├── single-mode.ts │ │ │ ├── split-mode.ts │ │ │ ├── split-tags-mode.ts │ │ │ ├── tags-mode.ts │ │ │ ├── target-tags.ts │ │ │ ├── target.ts │ │ │ └── types.ts │ └── tsconfig.json ├── fetch │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── hono │ ├── README.md │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── route.ts │ └── tsconfig.json ├── mcp │ ├── README.md │ ├── package.json │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── mock │ ├── README.md │ ├── package.json │ ├── src │ │ ├── delay.ts │ │ ├── faker │ │ │ ├── compatibleV9.test.ts │ │ │ ├── compatibleV9.ts │ │ │ ├── constants.ts │ │ │ ├── getters │ │ │ │ ├── combine.ts │ │ │ │ ├── index.ts │ │ │ │ ├── object.ts │ │ │ │ ├── route.test.ts │ │ │ │ ├── route.ts │ │ │ │ ├── scalar.test.ts │ │ │ │ └── scalar.ts │ │ │ └── resolvers │ │ │ │ ├── index.ts │ │ │ │ └── value.ts │ │ ├── index.ts │ │ ├── msw │ │ │ ├── index.ts │ │ │ └── mocks.ts │ │ └── types.ts │ └── tsconfig.json ├── orval │ ├── README.md │ ├── package.json │ ├── src │ │ ├── api.ts │ │ ├── bin │ │ │ └── orval.ts │ │ ├── client.ts │ │ ├── generate.ts │ │ ├── import-open-api.ts │ │ ├── import-specs.ts │ │ ├── index.ts │ │ ├── utils │ │ │ ├── executeHook.ts │ │ │ ├── github.ts │ │ │ ├── index.ts │ │ │ ├── options.ts │ │ │ ├── package-json.ts │ │ │ ├── request.ts │ │ │ ├── tsconfig.ts │ │ │ └── watcher.ts │ │ └── write-specs.ts │ └── tsconfig.json ├── query │ ├── README.md │ ├── package.json │ ├── src │ │ ├── client.ts │ │ ├── index.test.ts │ │ ├── index.ts │ │ ├── utils.test.ts │ │ └── utils.ts │ └── tsconfig.json ├── swr │ ├── README.md │ ├── package.json │ ├── src │ │ ├── client.ts │ │ └── index.ts │ └── tsconfig.json └── zod │ ├── README.md │ ├── package.json │ ├── src │ ├── compatibleV4.test.ts │ ├── compatibleV4.ts │ ├── index.ts │ └── zod.test.ts │ └── tsconfig.json ├── pnpm-workspace.yaml ├── samples ├── angular-app │ ├── .browserslistrc │ ├── .editorconfig │ ├── .gitignore │ ├── angular.json │ ├── orval.config.ts │ ├── package.json │ ├── petstore.yaml │ ├── src │ │ ├── api │ │ │ ├── endpoints │ │ │ │ └── pets │ │ │ │ │ ├── pets.msw.ts │ │ │ │ │ └── pets.service.ts │ │ │ ├── mocks │ │ │ │ ├── mock.module.ts │ │ │ │ ├── mock.service.ts │ │ │ │ ├── mock.setup.ts │ │ │ │ ├── mock.token.ts │ │ │ │ └── mock.type.ts │ │ │ ├── model │ │ │ │ ├── createPetsBody.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ └── pets.ts │ │ │ ├── mutator │ │ │ │ └── response-type.ts │ │ │ └── transformer │ │ │ │ └── add-version.js │ │ ├── app │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ └── logo.svg │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── mockServiceWorker.js │ │ ├── polyfills.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tslint.json ├── basic │ ├── api │ │ ├── endpoints │ │ │ ├── petstoreFromFileSpec.ts │ │ │ ├── petstoreFromFileSpecWithConfig.ts │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ ├── model │ │ │ ├── createPetsBody.ts │ │ │ ├── error.ts │ │ │ ├── index.ts │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ ├── listPetsParams.ts │ │ │ ├── listPetsRootArrayParams.ts │ │ │ ├── pet.ts │ │ │ ├── petCallingCode.ts │ │ │ ├── petCountry.ts │ │ │ ├── pets.ts │ │ │ ├── petsArray.ts │ │ │ └── petsNestedArray.ts │ │ ├── mutator │ │ │ └── response-type.ts │ │ └── transformer │ │ │ └── add-version.js │ ├── index.html │ ├── orval.config.ts │ ├── package.json │ └── petstore.yaml ├── hono │ ├── composite-routes-with-tags-split │ │ ├── .gitignore │ │ ├── README.md │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── src │ │ │ ├── app.ts │ │ │ ├── endpoints │ │ │ │ ├── pets │ │ │ │ │ ├── pets.context.ts │ │ │ │ │ ├── pets.handlers.ts │ │ │ │ │ └── pets.zod.ts │ │ │ │ └── validator.ts │ │ │ ├── routes.ts │ │ │ └── schemas │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ └── pets.ts │ │ ├── tsconfig.json │ │ └── wrangler.toml │ ├── hono-with-fetch-client │ │ ├── README.md │ │ ├── hono-app │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ ├── handlers │ │ │ │ │ ├── createPets.ts │ │ │ │ │ ├── listPets.ts │ │ │ │ │ ├── showPetById.ts │ │ │ │ │ └── updatePets.ts │ │ │ │ ├── index.ts │ │ │ │ ├── petstore.context.ts │ │ │ │ ├── petstore.schemas.ts │ │ │ │ ├── petstore.ts │ │ │ │ ├── petstore.validator.ts │ │ │ │ └── petstore.zod.ts │ │ │ ├── tsconfig.json │ │ │ └── wrangler.toml │ │ ├── next-app │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── app │ │ │ │ ├── favicon.ico │ │ │ │ ├── gen │ │ │ │ │ ├── models │ │ │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ │ │ ├── error.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ │ ├── pet.ts │ │ │ │ │ │ └── pets.ts │ │ │ │ │ └── pets │ │ │ │ │ │ ├── pets.msw.ts │ │ │ │ │ │ └── pets.ts │ │ │ │ ├── globals.css │ │ │ │ ├── layout.tsx │ │ │ │ ├── page.tsx │ │ │ │ └── pets.tsx │ │ │ ├── next-env.d.ts │ │ │ ├── next.config.mjs │ │ │ ├── package.json │ │ │ ├── postcss.config.mjs │ │ │ ├── public │ │ │ │ ├── next.svg │ │ │ │ └── vercel.svg │ │ │ ├── tailwind.config.ts │ │ │ └── tsconfig.json │ │ ├── orval.config.ts │ │ ├── package.json │ │ └── petstore.yaml │ └── hono-with-zod │ │ ├── .gitignore │ │ ├── README.md │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── src │ │ ├── handlers │ │ │ ├── createPets.ts │ │ │ ├── listPets.ts │ │ │ ├── showPetById.ts │ │ │ └── updatePets.ts │ │ ├── index.ts │ │ ├── mutators.ts │ │ ├── petstore.context.ts │ │ ├── petstore.schemas.ts │ │ ├── petstore.ts │ │ ├── petstore.validator.ts │ │ └── petstore.zod.ts │ │ ├── tsconfig.json │ │ └── wrangler.toml ├── mcp │ └── petstore │ │ ├── .editorconfig │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── src │ │ ├── handlers.ts │ │ ├── http-client.ts │ │ ├── http-schemas │ │ │ ├── apiResponse.ts │ │ │ ├── category.ts │ │ │ ├── findPetsByStatusParams.ts │ │ │ ├── findPetsByTagsParams.ts │ │ │ ├── getInventory200.ts │ │ │ ├── index.ts │ │ │ ├── loginUserParams.ts │ │ │ ├── order.ts │ │ │ ├── orderStatus.ts │ │ │ ├── pet.ts │ │ │ ├── petBody.ts │ │ │ ├── petStatus.ts │ │ │ ├── tag.ts │ │ │ ├── updatePetWithFormParams.ts │ │ │ ├── user.ts │ │ │ └── userArrayBody.ts │ │ ├── server.ts │ │ └── tool-schemas.zod.ts │ │ ├── tsconfig.json │ │ └── yarn.lock ├── next-app-with-fetch │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── app │ │ ├── favicon.ico │ │ ├── gen │ │ │ ├── models │ │ │ │ ├── cat.ts │ │ │ │ ├── catType.ts │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ ├── dachshund.ts │ │ │ │ ├── dachshundBreed.ts │ │ │ │ ├── dog.ts │ │ │ │ ├── dogType.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── labradoodle.ts │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ ├── petCallingCode.ts │ │ │ │ ├── petCountry.ts │ │ │ │ └── pets.ts │ │ │ └── pets │ │ │ │ ├── pets.msw.ts │ │ │ │ └── pets.ts │ │ ├── globals.css │ │ ├── layout.tsx │ │ ├── page.tsx │ │ └── pets.tsx │ ├── custom-fetch.ts │ ├── next.config.mjs │ ├── orval.config.ts │ ├── package.json │ ├── petstore.yaml │ ├── postcss.config.mjs │ ├── public │ │ ├── next.svg │ │ └── vercel.svg │ ├── tailwind.config.ts │ └── tsconfig.json ├── package.json ├── react-app-with-swr │ ├── basic │ │ ├── .gitignore │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ ├── mockServiceWorker.js │ │ │ └── robots.txt │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── api │ │ │ │ ├── endpoints │ │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ │ ├── model │ │ │ │ │ ├── createPetsBody.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ └── pets.ts │ │ │ │ ├── mutator │ │ │ │ │ └── custom-instance.ts │ │ │ │ └── transformer │ │ │ │ │ └── add-version.js │ │ │ ├── auth.context.tsx │ │ │ ├── index.css │ │ │ ├── index.tsx │ │ │ ├── logo.svg │ │ │ ├── mock.ts │ │ │ ├── react-app-env.d.ts │ │ │ ├── serviceWorker.ts │ │ │ └── setupTests.ts │ │ └── tsconfig.json │ └── fetch-client │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ └── vite.svg │ │ ├── src │ │ ├── App.css │ │ ├── App.tsx │ │ ├── api │ │ │ ├── endpoints │ │ │ │ ├── swaggerPetstore.msw.ts │ │ │ │ └── swaggerPetstore.ts │ │ │ └── models │ │ │ │ ├── createPetsBody.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ └── pets.ts │ │ ├── assets │ │ │ └── react.svg │ │ ├── index.css │ │ ├── main.tsx │ │ └── vite-env.d.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts ├── react-app │ ├── .env.development │ ├── .gitignore │ ├── docs-html-plugin │ │ ├── .nojekyll │ │ ├── assets │ │ │ ├── hierarchy.js │ │ │ ├── highlight.css │ │ │ ├── icons.js │ │ │ ├── icons.svg │ │ │ ├── main.js │ │ │ ├── navigation.js │ │ │ ├── search.js │ │ │ └── style.css │ │ ├── coverage.svg │ │ ├── functions │ │ │ ├── createPets.html │ │ │ ├── listPets.html │ │ │ └── showPetById.html │ │ ├── index.html │ │ ├── interfaces │ │ │ ├── Error.html │ │ │ └── Pet.html │ │ └── types │ │ │ ├── CreatePetsBody.html │ │ │ ├── CreatePetsResult.html │ │ │ ├── ListPetsParams.html │ │ │ ├── ListPetsResult.html │ │ │ ├── Pets.html │ │ │ └── ShowPetByIdResult.html │ ├── docs-html │ │ ├── .nojekyll │ │ ├── assets │ │ │ ├── hierarchy.js │ │ │ ├── highlight.css │ │ │ ├── icons.js │ │ │ ├── icons.svg │ │ │ ├── main.js │ │ │ ├── navigation.js │ │ │ ├── search.js │ │ │ └── style.css │ │ ├── functions │ │ │ ├── createPets.html │ │ │ ├── listPets.html │ │ │ └── showPetById.html │ │ ├── index.html │ │ ├── interfaces │ │ │ ├── Error.html │ │ │ └── Pet.html │ │ └── types │ │ │ ├── CreatePetsBody.html │ │ │ ├── CreatePetsResult.html │ │ │ ├── ListPetsParams.html │ │ │ ├── ListPetsResult.html │ │ │ ├── Pets.html │ │ │ └── ShowPetByIdResult.html │ ├── docs-markdown │ │ ├── .nojekyll │ │ ├── README.md │ │ ├── functions │ │ │ ├── createPets.md │ │ │ ├── listPets.md │ │ │ └── showPetById.md │ │ ├── interfaces │ │ │ ├── Error.md │ │ │ └── Pet.md │ │ └── type-aliases │ │ │ ├── CreatePetsBody.md │ │ │ ├── CreatePetsResult.md │ │ │ ├── ListPetsParams.md │ │ │ ├── ListPetsResult.md │ │ │ ├── Pets.md │ │ │ └── ShowPetByIdResult.md │ ├── orval.config.ts │ ├── package.json │ ├── petstore.yaml │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ ├── mockServiceWorker.js │ │ └── robots.txt │ ├── src │ │ ├── App.css │ │ ├── App.tsx │ │ ├── api │ │ │ ├── endpoints │ │ │ │ ├── petstoreFromFileSpecWithDocsHtml.ts │ │ │ │ ├── petstoreFromFileSpecWithDocsHtmlPlugin.ts │ │ │ │ ├── petstoreFromFileSpecWithDocsMarkdown.ts │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ ├── headers.ts │ │ │ ├── model │ │ │ │ ├── createPetsBody.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ └── pets.ts │ │ │ ├── mutator │ │ │ │ └── custom-instance.ts │ │ │ ├── transformer │ │ │ │ └── add-version.js │ │ │ ├── useApi.ts │ │ │ └── utilities.ts │ │ ├── auth.context.tsx │ │ ├── index.css │ │ ├── index.tsx │ │ ├── logo.svg │ │ ├── mock.ts │ │ ├── react-app-env.d.ts │ │ ├── serviceWorker.ts │ │ └── setupTests.ts │ └── tsconfig.json ├── react-query │ ├── basic │ │ ├── .gitignore │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ ├── mockServiceWorker.js │ │ │ └── robots.txt │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── api │ │ │ │ ├── endpoints │ │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ │ ├── model │ │ │ │ │ ├── cat.ts │ │ │ │ │ ├── catType.ts │ │ │ │ │ ├── createPetsBody.ts │ │ │ │ │ ├── createPetsParams.ts │ │ │ │ │ ├── createPetsSort.ts │ │ │ │ │ ├── dachshund.ts │ │ │ │ │ ├── dachshundBreed.ts │ │ │ │ │ ├── dog.ts │ │ │ │ │ ├── dogType.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── getPetFileById404.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── labradoodle.ts │ │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── listPetsSort.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ ├── petCallingCode.ts │ │ │ │ │ ├── petCountry.ts │ │ │ │ │ ├── pets.ts │ │ │ │ │ ├── petsArray.ts │ │ │ │ │ └── petsNestedArray.ts │ │ │ │ ├── mutator │ │ │ │ │ └── custom-instance.ts │ │ │ │ └── transformer │ │ │ │ │ └── add-version.js │ │ │ ├── auth.context.tsx │ │ │ ├── index.css │ │ │ ├── index.tsx │ │ │ ├── logo.svg │ │ │ ├── mock.ts │ │ │ ├── react-app-env.d.ts │ │ │ ├── serviceWorker.ts │ │ │ └── setupTests.ts │ │ └── tsconfig.json │ ├── custom-client │ │ ├── .gitignore │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ ├── mockServiceWorker.js │ │ │ └── robots.txt │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── api │ │ │ │ ├── endpoints │ │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ │ ├── model │ │ │ │ │ ├── createPetsBody.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ ├── petCallingCode.ts │ │ │ │ │ ├── petCountry.ts │ │ │ │ │ ├── petsArray.ts │ │ │ │ │ └── petsNestedArray.ts │ │ │ │ ├── mutator │ │ │ │ │ └── custom-client.ts │ │ │ │ └── transformer │ │ │ │ │ └── add-version.js │ │ │ ├── auth.context.tsx │ │ │ ├── index.css │ │ │ ├── index.tsx │ │ │ ├── logo.svg │ │ │ ├── mock.ts │ │ │ ├── react-app-env.d.ts │ │ │ ├── serviceWorker.ts │ │ │ └── setupTests.ts │ │ └── tsconfig.json │ ├── custom-fetch │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── App.css │ │ │ ├── App.tsx │ │ │ ├── assets │ │ │ │ └── react.svg │ │ │ ├── custom-fetch.ts │ │ │ ├── gen │ │ │ │ ├── models │ │ │ │ │ ├── cat.ts │ │ │ │ │ ├── catType.ts │ │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ │ ├── dachshund.ts │ │ │ │ │ ├── dachshundBreed.ts │ │ │ │ │ ├── dog.ts │ │ │ │ │ ├── dogType.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── labradoodle.ts │ │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ ├── petCallingCode.ts │ │ │ │ │ ├── petCountry.ts │ │ │ │ │ └── pets.ts │ │ │ │ └── pets │ │ │ │ │ ├── pets.msw.ts │ │ │ │ │ └── pets.ts │ │ │ ├── index.css │ │ │ ├── main.tsx │ │ │ ├── pets.tsx │ │ │ └── vite-env.d.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ ├── form-data-mutator │ │ ├── custom-form-data.ts │ │ ├── custom-instance.ts │ │ ├── endpoints.ts │ │ ├── models │ │ │ ├── createPetsBody.ts │ │ │ ├── error.ts │ │ │ ├── index.ts │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ ├── listPetsParams.ts │ │ │ ├── pet.ts │ │ │ ├── petCallingCode.ts │ │ │ ├── petCountry.ts │ │ │ ├── petsArray.ts │ │ │ └── petsNestedArray.ts │ │ ├── orval.config.ts │ │ ├── package.json │ │ └── petstore.yaml │ ├── form-data │ │ ├── custom-instance.ts │ │ ├── endpoints.ts │ │ ├── models │ │ │ ├── createPetsBody.ts │ │ │ ├── error.ts │ │ │ ├── index.ts │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ ├── listPetsParams.ts │ │ │ ├── pet.ts │ │ │ ├── petCallingCode.ts │ │ │ ├── petCountry.ts │ │ │ ├── petsArray.ts │ │ │ └── petsNestedArray.ts │ │ ├── orval.config.ts │ │ ├── package.json │ │ └── petstore.yaml │ ├── form-url-encoded-mutator │ │ ├── custom-form-url-encoded.ts │ │ ├── custom-instance.ts │ │ ├── endpoints.ts │ │ ├── models │ │ │ ├── createPetsBody.ts │ │ │ ├── error.ts │ │ │ ├── index.ts │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ ├── listPetsParams.ts │ │ │ ├── pet.ts │ │ │ ├── petCallingCode.ts │ │ │ ├── petCountry.ts │ │ │ ├── petsArray.ts │ │ │ └── petsNestedArray.ts │ │ ├── orval.config.ts │ │ ├── package.json │ │ └── petstore.yaml │ ├── form-url-encoded │ │ ├── custom-instance.ts │ │ ├── endpoints.ts │ │ ├── models │ │ │ ├── createPetsBody.ts │ │ │ ├── error.ts │ │ │ ├── index.ts │ │ │ ├── listPetsNestedArrayParams.ts │ │ │ ├── listPetsParams.ts │ │ │ ├── pet.ts │ │ │ ├── petCallingCode.ts │ │ │ ├── petCountry.ts │ │ │ ├── petsArray.ts │ │ │ └── petsNestedArray.ts │ │ ├── orval.config.ts │ │ ├── package.json │ │ └── petstore.yaml │ └── hook-mutator │ │ ├── endpoints.ts │ │ ├── models │ │ ├── createPetsBody.ts │ │ ├── error.ts │ │ ├── index.ts │ │ ├── listPetsNestedArrayParams.ts │ │ ├── listPetsParams.ts │ │ ├── pet.ts │ │ ├── petCallingCode.ts │ │ ├── petCountry.ts │ │ ├── petsArray.ts │ │ └── petsNestedArray.ts │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ └── use-custom-instance.ts ├── svelte-query │ ├── basic │ │ ├── .eslintignore │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── README.md │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── src │ │ │ ├── api │ │ │ │ ├── endpoints │ │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ │ ├── model │ │ │ │ │ ├── createPetsBody.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ └── pets.ts │ │ │ │ ├── mutator │ │ │ │ │ └── custom-instance.ts │ │ │ │ └── transformer │ │ │ │ │ └── add-version.cjs │ │ │ ├── app.css │ │ │ ├── app.d.ts │ │ │ ├── app.html │ │ │ ├── lib │ │ │ │ └── pets.svelte │ │ │ ├── mocks │ │ │ │ ├── browser.ts │ │ │ │ ├── index.ts │ │ │ │ └── server.ts │ │ │ └── routes │ │ │ │ ├── +layout.svelte │ │ │ │ └── +page.svelte │ │ ├── static │ │ │ ├── favicon.png │ │ │ ├── logo.svg │ │ │ └── mockServiceWorker.js │ │ ├── svelte.config.js │ │ ├── tsconfig.json │ │ └── vite.config.ts │ └── custom-fetch │ │ ├── .gitignore │ │ ├── .vscode │ │ └── extensions.json │ │ ├── README.md │ │ ├── index.html │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ └── vite.svg │ │ ├── src │ │ ├── App.svelte │ │ ├── app.css │ │ ├── assets │ │ │ └── svelte.svg │ │ ├── custom-fetch.ts │ │ ├── gen │ │ │ ├── models │ │ │ │ ├── cat.ts │ │ │ │ ├── catType.ts │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ ├── dachshund.ts │ │ │ │ ├── dachshundBreed.ts │ │ │ │ ├── dog.ts │ │ │ │ ├── dogType.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── labradoodle.ts │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ ├── petCallingCode.ts │ │ │ │ ├── petCountry.ts │ │ │ │ └── pets.ts │ │ │ └── pets │ │ │ │ ├── pets.msw.ts │ │ │ │ └── pets.ts │ │ ├── lib │ │ │ ├── Counter.svelte │ │ │ └── Pets.svelte │ │ ├── main.ts │ │ └── vite-env.d.ts │ │ ├── svelte.config.js │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts ├── swr-with-zod │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── orval.config.ts │ ├── package.json │ ├── petstore.yaml │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.css │ │ ├── App.tsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── gen │ │ │ ├── endpoints │ │ │ │ └── pets │ │ │ │ │ ├── pets.msw.ts │ │ │ │ │ ├── pets.ts │ │ │ │ │ └── pets.zod.ts │ │ │ └── models │ │ │ │ ├── cat.ts │ │ │ │ ├── catType.ts │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ ├── dachshund.ts │ │ │ │ ├── dachshundBreed.ts │ │ │ │ ├── dog.ts │ │ │ │ ├── dogType.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── labradoodle.ts │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ ├── petCallingCode.ts │ │ │ │ ├── petCountry.ts │ │ │ │ └── pets.ts │ │ ├── index.css │ │ ├── main.tsx │ │ └── vite-env.d.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts ├── turbo.json ├── vue-query │ ├── custom-fetch │ │ ├── .gitignore │ │ ├── .vscode │ │ │ └── extensions.json │ │ ├── README.md │ │ ├── index.html │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ │ └── vite.svg │ │ ├── src │ │ │ ├── App.vue │ │ │ ├── assets │ │ │ │ └── vue.svg │ │ │ ├── components │ │ │ │ └── HelloWorld.vue │ │ │ ├── custom-fetch.ts │ │ │ ├── gen │ │ │ │ ├── models │ │ │ │ │ ├── cat.ts │ │ │ │ │ ├── catType.ts │ │ │ │ │ ├── createPetsBodyItem.ts │ │ │ │ │ ├── dachshund.ts │ │ │ │ │ ├── dachshundBreed.ts │ │ │ │ │ ├── dog.ts │ │ │ │ │ ├── dogType.ts │ │ │ │ │ ├── error.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── labradoodle.ts │ │ │ │ │ ├── labradoodleBreed.ts │ │ │ │ │ ├── listPetsParams.ts │ │ │ │ │ ├── pet.ts │ │ │ │ │ ├── petCallingCode.ts │ │ │ │ │ ├── petCountry.ts │ │ │ │ │ └── pets.ts │ │ │ │ └── pets │ │ │ │ │ ├── pets.msw.ts │ │ │ │ │ └── pets.ts │ │ │ ├── main.ts │ │ │ ├── style.css │ │ │ └── vite-env.d.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ └── vite.config.ts │ └── vue-query-basic │ │ ├── .gitignore │ │ ├── README.md │ │ ├── index.html │ │ ├── orval.config.ts │ │ ├── package.json │ │ ├── petstore.yaml │ │ ├── public │ │ ├── favicon.ico │ │ └── mockServiceWorker.js │ │ ├── src │ │ ├── App.vue │ │ ├── api │ │ │ ├── endpoints │ │ │ │ ├── petstoreFromFileSpecWithTransformer.msw.ts │ │ │ │ └── petstoreFromFileSpecWithTransformer.ts │ │ │ ├── model │ │ │ │ ├── createPetsBody.ts │ │ │ │ ├── domainStatusEnum.ts │ │ │ │ ├── error.ts │ │ │ │ ├── index.ts │ │ │ │ ├── listPetsParams.ts │ │ │ │ ├── pet.ts │ │ │ │ └── pets.ts │ │ │ ├── mutator │ │ │ │ └── custom-instance.ts │ │ │ └── transformer │ │ │ │ └── add-version.js │ │ ├── assets │ │ │ └── logo.svg │ │ ├── components │ │ │ ├── pet.vue │ │ │ ├── pets.spec.ts │ │ │ ├── pets.vue │ │ │ └── tests │ │ │ │ ├── path-parameter-reactivity-pet.spec.ts │ │ │ │ ├── path-parameter-reactivity-pet.vue │ │ │ │ ├── query-enabled-reactivity-pet-id.spec.ts │ │ │ │ ├── query-enabled-reactivity-pet-id.vue │ │ │ │ ├── query-enabled-reactivity-version.spec.ts │ │ │ │ ├── query-enabled-reactivity-version.vue │ │ │ │ ├── url-encode.spec.ts │ │ │ │ └── url-encode.vue │ │ ├── constants.ts │ │ ├── main.ts │ │ ├── mock.ts │ │ ├── mocks │ │ │ ├── handlers.ts │ │ │ └── server.ts │ │ ├── setupTests.ts │ │ ├── shims-vue.d.ts │ │ ├── tests │ │ │ └── all-params-optional.test-d.ts │ │ └── vite-env.d.ts │ │ ├── tsconfig.json │ │ └── vite.config.ts └── yarn.lock ├── tests ├── configs │ ├── angular.config.ts │ ├── axios.config.ts │ ├── default.config.ts │ ├── fetch.config.ts │ ├── hono.config.ts │ ├── mcp.config.ts │ ├── mock.config.ts │ ├── multi-file.config.ts │ ├── react-query.config.ts │ ├── svelte-query.config.ts │ ├── swr.config.ts │ ├── vue-query.config.ts │ └── zod.config.ts ├── mutators │ ├── custom-client-angular.ts │ ├── custom-client.ts │ ├── custom-fetch.ts │ ├── custom-form-data.ts │ ├── custom-form-url-encoded.ts │ ├── custom-instance.ts │ ├── custom-mutation.ts │ ├── error-type.ts │ ├── multi-arguments.ts │ ├── response-type.ts │ ├── test.ts │ ├── use-custom-instance-with-second-parameter.ts │ ├── use-custom-instance.ts │ └── zod-preprocess.ts ├── package.json ├── regressions │ ├── arrays.ts │ ├── duplicateTags.ts │ └── react-query.ts ├── specifications │ ├── all-of-all-of.yaml │ ├── all-of-one-of.yaml │ ├── all-of-primitive.yaml │ ├── all-of-ref.yaml │ ├── all-of-required-in-parent.yaml │ ├── all-of-without-type.yaml │ ├── all-of.yaml │ ├── any-of-primitive.yaml │ ├── any-of.yaml │ ├── arrays.yaml │ ├── blob-file.yaml │ ├── circular-v2.yaml │ ├── circular.yaml │ ├── combined-enum.yaml │ ├── const.yaml │ ├── deeply-nested-refs.yaml │ ├── default-response.yaml │ ├── default-status.yaml │ ├── deprecated.yaml │ ├── empty-response.yaml │ ├── endpoints-named-delay.yaml │ ├── enum-refs.yaml │ ├── enums.yaml │ ├── errors.yaml │ ├── example-v3-1.yaml │ ├── examples.yaml │ ├── form-data-nested.yaml │ ├── form-data-optional-request.yaml │ ├── form-data.yaml │ ├── form-url-encoded.yaml │ ├── format.yaml │ ├── import-from-subdirectory │ │ ├── petstore.yaml │ │ └── subdirectory │ │ │ ├── another-file.yaml │ │ │ └── petstore.yaml │ ├── lowercase-discriminator.yaml │ ├── models-with-special-char.yaml │ ├── multi-files │ │ ├── api.yaml │ │ └── schemas │ │ │ ├── person.yaml │ │ │ └── pet.yaml │ ├── multi-query-params.yaml │ ├── multiple-tags.yaml │ ├── no-content-with-default.yaml │ ├── null-type-v3-0.yaml │ ├── null-type.yaml │ ├── one-of-primitive.yaml │ ├── one-of.yaml │ ├── optional-request-body.yaml │ ├── parameters.yaml │ ├── pattern.yaml │ ├── petstore.yaml │ ├── polymorphic.yaml │ ├── readonly.yaml │ ├── regressions.yaml │ ├── translation.yaml │ ├── typed-arrays-tuples-v3-1.yaml │ ├── typelessEnum.yaml │ └── url-paths.yaml ├── transformers │ └── add-version.js ├── tsconfig.json └── yarn.lock ├── tsconfig.base.json ├── turbo.json ├── types ├── esutils.d.ts ├── ibm-openapi-validator.d.ts └── swagger2openapi.d.ts └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [anymaniax, melloware, soartec-lab] 2 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | yarn commitlint --edit 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | yarn lint 2 | yarn test:ci 3 | yarn format:staged 4 | -------------------------------------------------------------------------------- /.lintstagedrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "*": "prettier --check" 3 | } 4 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | * 2 | !dist/**/* 3 | !README.md 4 | !package.json -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # Dependencies 4 | node_modules 5 | 6 | # Build 7 | .next 8 | **/dist 9 | .husky 10 | mockServiceWorker.js 11 | yarn.lock 12 | .svelte-kit 13 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "bracketSpacing": true, 4 | "printWidth": 80, 5 | "tabWidth": 2, 6 | "semi": true, 7 | "singleQuote": true, 8 | "trailingComma": "all", 9 | "endOfLine": "lf" 10 | } 11 | -------------------------------------------------------------------------------- /.release-it.json: -------------------------------------------------------------------------------- 1 | { 2 | "npm": false, 3 | "git": { 4 | "commitMessage": "chore(release): ${version}" 5 | }, 6 | "github": { 7 | "release": true, 8 | "draft": true 9 | }, 10 | "plugins": { 11 | "@release-it/conventional-changelog": { 12 | "preset": "angular" 13 | }, 14 | "@release-it-plugins/workspaces": { 15 | "publish": false 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": ["listitem", "openapi", "Orval", "Petstore", "tanstack"] 3 | } 4 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | packageExtensions: 3 | '@vue/test-utils@*': 4 | peerDependencies: 5 | vue: '*' 6 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .next 2 | .now 3 | .env 4 | .env.* 5 | node_modules 6 | *.log 7 | .DS_Store 8 | .vercel -------------------------------------------------------------------------------- /docs/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./src" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/postcss.config.js: -------------------------------------------------------------------------------- 1 | // postcss.config.js 2 | module.exports = { 3 | plugins: { 4 | tailwindcss: {}, 5 | autoprefixer: {}, 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /docs/public/images/og-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/docs/public/images/og-image.png -------------------------------------------------------------------------------- /docs/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /docs/scripts/build-sitemap.js: -------------------------------------------------------------------------------- 1 | const sitemap = require('nextjs-sitemap-generator'); 2 | 3 | sitemap({ 4 | baseUrl: 'https://orval.dev', 5 | pagesDirectory: process.cwd() + '/src/pages', 6 | targetDirectory: 'public/', 7 | ignoredExtensions: ['js', 'map'], 8 | ignoredPaths: ['/404'], 9 | }); 10 | -------------------------------------------------------------------------------- /docs/src/components/ArrowRight.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | export function ArrowRight({ fill = '#718096', width = 6, height = 10 }) { 3 | return ( 4 | 11 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /docs/src/components/Banner.js: -------------------------------------------------------------------------------- 1 | export function Banner() { 2 | return null; // return ( 3 | //
4 | //
5 | // formium 6 | //
7 | // Hassle-free form storage for static sites → 8 | //
9 | //
10 | //
11 | // ); 12 | } 13 | -------------------------------------------------------------------------------- /docs/src/components/Container.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import cn from 'classnames'; 3 | export const Container = (props) => { 4 | return
; 5 | }; 6 | Container.displayName = 'Container'; 7 | -------------------------------------------------------------------------------- /docs/src/components/ExternalLink.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | export function ExternalLink(props) { 3 | return ; 4 | } 5 | -------------------------------------------------------------------------------- /docs/src/components/Logo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/docs/src/components/Logo.js -------------------------------------------------------------------------------- /docs/src/components/MDXComponents.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import dynamic from 'next/dynamic'; 3 | export default { 4 | // default tags 5 | pre: (p) =>
,
6 |   code: dynamic(() => import('./Highlight2')), // Counter: dynamic(() => import('./counter')),
7 | };
8 | 


--------------------------------------------------------------------------------
/docs/src/components/Markdown.js:
--------------------------------------------------------------------------------
 1 | import * as React from 'react';
 2 | import markdownStyles from './markdown.module.css';
 3 | export const Markdown = ({ html: content }) => {
 4 |   return (
 5 |     
11 | ); 12 | }; 13 | Markdown.displayName = 'PostBody'; 14 | -------------------------------------------------------------------------------- /docs/src/components/Toc.module.css: -------------------------------------------------------------------------------- 1 | /* purgecss start ignore */ 2 | 3 | .contents__list { 4 | overflow: overlay; 5 | height: calc(((100vh - 4.5rem) - 64px) - 42px); 6 | } 7 | 8 | .contents__link { 9 | @apply text-gray-700; 10 | } 11 | 12 | .contents__link:hover { 13 | @apply text-blue-600; 14 | } 15 | 16 | .contents__link--active { 17 | @apply font-medium text-coral-default; 18 | } 19 | /* purgecss end ignore */ 20 | -------------------------------------------------------------------------------- /docs/src/components/blog/ExternalLink.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | export default function ExternalLink(props) { 3 | return ; 4 | } 5 | -------------------------------------------------------------------------------- /docs/src/components/blog/dynamic.js: -------------------------------------------------------------------------------- 1 | import dynamic from 'next/dynamic'; 2 | import ExtLink from './ExternalLink'; 3 | export default { 4 | // default tags 5 | ol: 'ol', 6 | ul: 'ul', 7 | li: 'li', 8 | p: 'p', 9 | blockquote: 'blockquote', 10 | a: ExtLink, 11 | Image: dynamic(() => import('./Image')), 12 | Code: dynamic(() => import('../Highlight')), // Counter: dynamic(() => import('./counter')), 13 | }; 14 | -------------------------------------------------------------------------------- /docs/src/components/blog/intersection-observer/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './intersection-observer'; 2 | -------------------------------------------------------------------------------- /docs/src/components/clients/Client.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { LazyImage } from '../LazyImage'; 3 | export const Client = React.memo(({ name, image, style, ...rest }) => ( 4 | 5 | 12 | 13 | )); 14 | -------------------------------------------------------------------------------- /docs/src/components/utils/throttle.js: -------------------------------------------------------------------------------- 1 | export const throttle = (func, limit) => { 2 | let inThrottle; 3 | return function () { 4 | const args = arguments; // @ts-ignore 5 | 6 | const context = this; 7 | 8 | if (!inThrottle) { 9 | func.apply(context, args); 10 | inThrottle = true; 11 | setTimeout(() => (inThrottle = false), limit); 12 | } 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /docs/src/lib/docs/findRouteByPath.js: -------------------------------------------------------------------------------- 1 | import { removeFromLast } from './utils'; 2 | // @ts-ignore 3 | export function findRouteByPath(path, routes) { 4 | // eslint-disable-next-line 5 | for (const route of routes) { 6 | if (route.path && removeFromLast(route.path, '.') === path) { 7 | return route; 8 | } 9 | 10 | const childPath = route.routes && findRouteByPath(path, route.routes); 11 | if (childPath) return childPath; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/src/lib/docs/utils.js: -------------------------------------------------------------------------------- 1 | export function removeFromLast(path, key) { 2 | const i = path.lastIndexOf(key); 3 | return i === -1 ? path : path.substring(0, i); 4 | } 5 | -------------------------------------------------------------------------------- /docs/src/lib/fs-utils.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import { promisify } from 'util'; 3 | export const readFile = promisify(fs.readFile); 4 | export const writeFile = promisify(fs.writeFile); 5 | -------------------------------------------------------------------------------- /docs/src/manifests/getManifest.js: -------------------------------------------------------------------------------- 1 | import manifest from './manifest.json'; 2 | 3 | const versions = {}; 4 | 5 | export const versionList = Object.keys(versions); 6 | export const getManifest = (tag) => { 7 | return tag ? versions[tag] : manifest; 8 | }; 9 | -------------------------------------------------------------------------------- /docs/src/pages/404.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { LayoutDocs } from '../components/LayoutDocs'; 3 | 4 | export default function NotFound() { 5 | return ( 6 | 7 |

Snap! We couldn't find that page.

8 |

Please use the menu to find what you're looking for.

9 | 10 |
11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /docs/src/pages/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: installation 3 | title: Installation 4 | --- 5 | 6 | You can install Orval with
NPM or Yarn. 7 | 8 | Using NPM: 9 | 10 | ```bash 11 | $ npm i orval -D 12 | ``` 13 | 14 | Using Yarn: 15 | 16 | ``` 17 | $ yarn add orval -D 18 | ``` 19 | 20 | Using pnpm: 21 | 22 | ``` 23 | $ pnpm add orval -D 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/src/pages/reference/integration.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: integration 3 | title: Integration 4 | --- 5 | 6 | ### Import script 7 | 8 | Orval gives you the possibility to import Orval. 9 | 10 | It expose a function which takes a path to the Orval config as the argument. 11 | 12 | ```js 13 | import orval from 'orval'; 14 | 15 | orval('./orval.config.js'); 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/src/styles/shared.module.css: -------------------------------------------------------------------------------- 1 | .layout img { 2 | margin: auto; 3 | max-width: 98%; 4 | display: block; 5 | height: auto; 6 | } 7 | -------------------------------------------------------------------------------- /docs/src/users.js: -------------------------------------------------------------------------------- 1 | export const users = []; 2 | -------------------------------------------------------------------------------- /docs/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "project": "orval" 3 | } 4 | -------------------------------------------------------------------------------- /packages/angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@orval/angular", 3 | "version": "7.9.0", 4 | "license": "MIT", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "build": "tsup ./src/index.ts --target node12 --clean --sourcemap --dts", 12 | "dev": "tsup ./src/index.ts --target node12 --clean --sourcemap --watch src", 13 | "lint": "eslint src/**/*.ts" 14 | }, 15 | "dependencies": { 16 | "@orval/core": "7.9.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/axios/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@orval/axios", 3 | "version": "7.9.0", 4 | "license": "MIT", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "build": "tsup ./src/index.ts --target node12 --clean --sourcemap --dts", 12 | "dev": "tsup ./src/index.ts --target node12 --clean --sourcemap --watch src", 13 | "lint": "eslint src/**/*.ts" 14 | }, 15 | "dependencies": { 16 | "@orval/core": "7.9.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/axios/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/src/generators/index.ts: -------------------------------------------------------------------------------- 1 | export * from './component-definition'; 2 | export * from './imports'; 3 | export * from './models-inline'; 4 | export * from './mutator'; 5 | export * from './options'; 6 | export * from './parameter-definition'; 7 | export * from './schema-definition'; 8 | export * from './verbs-options'; 9 | -------------------------------------------------------------------------------- /packages/core/src/generators/models-inline.ts: -------------------------------------------------------------------------------- 1 | import { GeneratorSchema } from '../types'; 2 | 3 | export const generateModelInline = (acc: string, model: string): string => 4 | acc + `${model}\n`; 5 | 6 | export const generateModelsInline = ( 7 | obj: Record, 8 | ): string => { 9 | const schemas = Object.values(obj).flatMap((it) => it); 10 | 11 | return schemas.reduce( 12 | (acc, { model }) => generateModelInline(acc, model), 13 | '', 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/core/src/getters/index.ts: -------------------------------------------------------------------------------- 1 | export * from './array'; 2 | export * from './body'; 3 | export * from './combine'; 4 | export * from './discriminators'; 5 | export * from './enum'; 6 | export * from './keys'; 7 | export * from './object'; 8 | export * from './operation'; 9 | export * from './parameters'; 10 | export * from './params'; 11 | export * from './props'; 12 | export * from './query-params'; 13 | export * from './ref'; 14 | export * from './res-req-types'; 15 | export * from './response'; 16 | export * from './route'; 17 | export * from './scalar'; 18 | -------------------------------------------------------------------------------- /packages/core/src/getters/keys.ts: -------------------------------------------------------------------------------- 1 | import { keyword } from 'esutils'; 2 | 3 | export const getKey = (key: string) => { 4 | return keyword.isIdentifierNameES5(key) ? key : `'${key}'`; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './generators'; 3 | export * from './getters'; 4 | export * from './resolvers'; 5 | export * from './types'; 6 | export * from './utils'; 7 | export * from './writers'; 8 | -------------------------------------------------------------------------------- /packages/core/src/resolvers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './object'; 2 | export * from './ref'; 3 | export * from './value'; 4 | -------------------------------------------------------------------------------- /packages/core/src/utils/compare-version.ts: -------------------------------------------------------------------------------- 1 | import { compare, CompareOperator } from 'compare-versions'; 2 | 3 | export const compareVersions = ( 4 | firstVersion: string, 5 | secondVersions: string, 6 | operator: CompareOperator = '>=', 7 | ) => { 8 | if (firstVersion === 'latest' || firstVersion === '*') { 9 | return true; 10 | } 11 | 12 | return compare( 13 | firstVersion.replace(/(\s(.*))/, ''), 14 | secondVersions, 15 | operator, 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /packages/core/src/utils/extension.ts: -------------------------------------------------------------------------------- 1 | export const getExtension = (path: string) => 2 | path.toLowerCase().includes('.yaml') || path.toLowerCase().includes('.yml') 3 | ? 'yaml' 4 | : 'json'; 5 | -------------------------------------------------------------------------------- /packages/core/src/utils/fileExtensions.ts: -------------------------------------------------------------------------------- 1 | import { ClientMockBuilder, GlobalMockOptions } from '../types'; 2 | import { isFunction } from './assertion'; 3 | 4 | export const getMockFileExtensionByTypeName = ( 5 | mock: GlobalMockOptions | ClientMockBuilder, 6 | ) => { 7 | if (isFunction(mock)) { 8 | return 'msw'; 9 | } 10 | switch (mock.type) { 11 | default: // case 'msw': 12 | return 'msw'; 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/core/src/utils/is-body-verb.ts: -------------------------------------------------------------------------------- 1 | import { Verbs } from '../types'; 2 | import { VERBS_WITH_BODY } from '../constants'; 3 | 4 | export const getIsBodyVerb = (verb: Verbs) => VERBS_WITH_BODY.includes(verb); 5 | -------------------------------------------------------------------------------- /packages/core/src/utils/occurrence.ts: -------------------------------------------------------------------------------- 1 | export const count = (str: string = '', key: string) => { 2 | if (!str) { 3 | return 0; 4 | } 5 | 6 | return (str.match(new RegExp(key, 'g')) ?? []).length; 7 | }; 8 | -------------------------------------------------------------------------------- /packages/core/src/utils/sort.ts: -------------------------------------------------------------------------------- 1 | export const sortByPriority = ( 2 | arr: (T & { default?: boolean; required?: boolean })[], 3 | ) => 4 | arr.sort((a, b) => { 5 | if (a.default) { 6 | return 1; 7 | } 8 | 9 | if (b.default) { 10 | return -1; 11 | } 12 | 13 | if (a.required && b.required) { 14 | return 0; 15 | } 16 | 17 | if (a.required) { 18 | return -1; 19 | } 20 | 21 | if (b.required) { 22 | return 1; 23 | } 24 | return 0; 25 | }); 26 | -------------------------------------------------------------------------------- /packages/core/src/utils/tsconfig.ts: -------------------------------------------------------------------------------- 1 | import { Tsconfig } from '../types'; 2 | 3 | export const isSyntheticDefaultImportsAllow = (config?: Tsconfig) => { 4 | if (!config) { 5 | return true; 6 | } 7 | 8 | return !!( 9 | config?.compilerOptions?.allowSyntheticDefaultImports ?? 10 | config?.compilerOptions?.esModuleInterop 11 | ); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/core/src/writers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './schemas'; 2 | export * from './types'; 3 | export * from './single-mode'; 4 | export * from './split-mode'; 5 | export * from './split-tags-mode'; 6 | export * from './tags-mode'; 7 | export * from './target'; 8 | export * from './target-tags'; 9 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts", "../../types/**.d.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/fetch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@orval/fetch", 3 | "version": "7.9.0", 4 | "license": "MIT", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "build": "tsup ./src/index.ts --target node12 --clean --sourcemap --dts", 12 | "dev": "tsup ./src/index.ts --target node12 --clean --sourcemap --watch src", 13 | "lint": "eslint src/**/*.ts" 14 | }, 15 | "dependencies": { 16 | "@orval/core": "7.9.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fetch/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/hono/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/mcp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@orval/mcp", 3 | "version": "7.9.0", 4 | "license": "MIT", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "build": "tsup ./src/index.ts --target node12 --clean --dts --sourcemap", 12 | "dev": "tsup ./src/index.ts --target node12 --clean --watch --sourcemap src", 13 | "lint": "eslint src/**/*.ts" 14 | }, 15 | "dependencies": { 16 | "@orval/core": "7.9.0", 17 | "@orval/zod": "7.9.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/mcp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/mock/src/faker/getters/index.ts: -------------------------------------------------------------------------------- 1 | export * from './combine'; 2 | export * from './object'; 3 | export * from './route'; 4 | export * from './scalar'; 5 | -------------------------------------------------------------------------------- /packages/mock/src/faker/resolvers/index.ts: -------------------------------------------------------------------------------- 1 | export * from './value'; 2 | -------------------------------------------------------------------------------- /packages/mock/src/types.ts: -------------------------------------------------------------------------------- 1 | import { GeneratorImport } from '@orval/core'; 2 | import { SchemaObject } from 'openapi3-ts/oas30'; 3 | 4 | export interface MockDefinition { 5 | value: string; 6 | enums?: string[]; 7 | imports: GeneratorImport[]; 8 | name: string; 9 | overrided?: boolean; 10 | includedProperties?: string[]; 11 | } 12 | 13 | export type MockSchemaObject = SchemaObject & { 14 | name: string; 15 | path?: string; 16 | isRef?: boolean; 17 | }; 18 | -------------------------------------------------------------------------------- /packages/mock/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/orval/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './executeHook'; 2 | export * from './github'; 3 | export * from './options'; 4 | export * from './package-json'; 5 | export * from './request'; 6 | export * from './tsconfig'; 7 | export * from './watcher'; 8 | -------------------------------------------------------------------------------- /packages/orval/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts", "../core/src/utils/fileExtensions.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/query/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/swr/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@orval/swr", 3 | "version": "7.9.0", 4 | "license": "MIT", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "files": [ 8 | "dist" 9 | ], 10 | "scripts": { 11 | "build": "tsup ./src/index.ts --target node12 --clean --sourcemap --dts", 12 | "dev": "tsup ./src/index.ts --target node12 --clean --sourcemap --watch src", 13 | "lint": "eslint src/**/*.ts" 14 | }, 15 | "dependencies": { 16 | "@orval/core": "7.9.0", 17 | "@orval/fetch": "7.9.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/swr/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/zod/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["src/**/*.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /samples/angular-app/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /samples/angular-app/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/mocks/mock.setup.ts: -------------------------------------------------------------------------------- 1 | import { MockService } from './mock.service'; 2 | 3 | export function initMocks(mockService: MockService) { 4 | return () => mockService.loadMock(); 5 | } 6 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/mocks/mock.token.ts: -------------------------------------------------------------------------------- 1 | import { InjectionToken } from '@angular/core'; 2 | 3 | export const MOCKED_API = new InjectionToken('MockedApi'); 4 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/mocks/mock.type.ts: -------------------------------------------------------------------------------- 1 | export interface MockedApi { 2 | pet: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | id: number; 10 | name: string; 11 | tag?: string; 12 | } 13 | -------------------------------------------------------------------------------- /samples/angular-app/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/angular-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/angular-app/src/assets/.gitkeep -------------------------------------------------------------------------------- /samples/angular-app/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | modules: [], 4 | }; 5 | -------------------------------------------------------------------------------- /samples/angular-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/angular-app/src/favicon.ico -------------------------------------------------------------------------------- /samples/angular-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/angular-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule) 13 | .catch((err) => console.error(err)); 14 | -------------------------------------------------------------------------------- /samples/angular-app/src/styles.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | min-height: 100vh; 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: calc(10px + 2vmin); 12 | color: black; 13 | } 14 | 15 | .App-logo { 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /samples/angular-app/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": ["src/main.ts", "src/polyfills.ts"], 8 | "include": ["src/**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /samples/basic/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/basic/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/basic/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './pets'; 16 | export * from './petsArray'; 17 | export * from './petsNestedArray'; 18 | -------------------------------------------------------------------------------- /samples/basic/api/model/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/basic/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/basic/api/model/listPetsRootArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v6.28.2 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsRootArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/basic/api/model/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/basic/api/model/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/basic/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v6.28.2 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/basic/api/model/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/basic/api/model/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/basic/api/mutator/response-type.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosRequestConfig } from 'axios'; 2 | 3 | export const getWithResponseType = ( 4 | config: AxiosRequestConfig, 5 | ): Promise => { 6 | return axios({ ...config, responseType: 'json' }).then(({ data }) => data); 7 | }; 8 | 9 | export default getWithResponseType; 10 | -------------------------------------------------------------------------------- /samples/basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Orval basic example 7 | 8 | 9 |

Orval basic example

10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | 4 | # dev 5 | .yarn/ 6 | !.yarn/releases 7 | .vscode/* 8 | !.vscode/launch.json 9 | !.vscode/*.code-snippets 10 | .idea/workspace.xml 11 | .idea/usage.statistics.xml 12 | .idea/shelf 13 | 14 | # deps 15 | node_modules/ 16 | .wrangler 17 | 18 | # env 19 | .env 20 | .env.production 21 | .dev.vars 22 | 23 | # logs 24 | logs/ 25 | *.log 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | pnpm-debug.log* 30 | lerna-debug.log* 31 | 32 | # misc 33 | .DS_Store 34 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/README.md: -------------------------------------------------------------------------------- 1 | # composite-routes-with-tags-split 2 | 3 | ``` 4 | yarn install 5 | yarn dev 6 | ``` 7 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/app.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono'; 2 | import routes from './routes'; 3 | 4 | const app = new Hono(); 5 | 6 | app.route('/', routes); 7 | 8 | app.get('/', (c) => { 9 | return c.text('Hello Hono!'); 10 | }); 11 | 12 | export default app; 13 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBodyItem'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | id: number; 10 | name: string; 11 | tag: string; 12 | } 13 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/src/schemas/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "strict": true, 7 | "skipLibCheck": true, 8 | "lib": ["ESNext"], 9 | "types": ["@cloudflare/workers-types/2023-07-01"], 10 | "jsx": "react-jsx", 11 | "jsxImportSource": "hono/jsx" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/hono/composite-routes-with-tags-split/wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "hono" 2 | compatibility_date = "2024-08-24" 3 | 4 | # [vars] 5 | # MY_VAR = "my-variable" 6 | 7 | # [[kv_namespaces]] 8 | # binding = "MY_KV_NAMESPACE" 9 | # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 10 | 11 | # [[r2_buckets]] 12 | # binding = "MY_BUCKET" 13 | # bucket_name = "my-bucket" 14 | 15 | # [[d1_databases]] 16 | # binding = "DB" 17 | # database_name = "my-database" 18 | # database_id = "" 19 | 20 | # [ai] 21 | # binding = "AI" -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/README.md: -------------------------------------------------------------------------------- 1 | # hono-with-fetch-client 2 | 3 | This is a sample app that uses `hono` as a backend and `Next.js` and `fetch` as clients for seamless schema-first development. 4 | 5 | ## hono-app 6 | 7 | ``` 8 | cd hono-app 9 | yarn install 10 | yarn dev 11 | ``` 12 | 13 | ## next-app 14 | 15 | ``` 16 | cd next-app 17 | yarn install 18 | yarn dev 19 | ``` 20 | 21 | https://github.com/user-attachments/assets/bd3ec820-6ca4-40e2-a077-8954a765683f 22 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | 4 | # dev 5 | .yarn/ 6 | !.yarn/releases 7 | .vscode/* 8 | !.vscode/launch.json 9 | !.vscode/*.code-snippets 10 | .idea/workspace.xml 11 | .idea/usage.statistics.xml 12 | .idea/shelf 13 | 14 | # deps 15 | node_modules/ 16 | .wrangler 17 | 18 | # env 19 | .env 20 | .env.production 21 | .dev.vars 22 | 23 | # logs 24 | logs/ 25 | *.log 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | pnpm-debug.log* 30 | lerna-debug.log* 31 | 32 | # misc 33 | .DS_Store 34 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ``` 7 | npm run deploy 8 | ``` 9 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hono-app", 3 | "scripts": { 4 | "dev": "wrangler dev src/petstore.ts --ip 0.0.0.0", 5 | "deploy": "wrangler deploy --minify src/index.ts" 6 | }, 7 | "dependencies": { 8 | "hono": "^4.5.8" 9 | }, 10 | "devDependencies": { 11 | "@cloudflare/workers-types": "^4.20240529.0", 12 | "wrangler": "^3.57.2" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/src/handlers/createPets.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { CreatePetsContext } from '../petstore.context'; 4 | import { createPetsBody, createPetsResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const createPetsHandlers = factory.createHandlers( 9 | zValidator('json', createPetsBody), 10 | zValidator('response', createPetsResponse), 11 | async (c: CreatePetsContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/src/handlers/updatePets.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { UpdatePetsContext } from '../petstore.context'; 4 | import { updatePetsBody, updatePetsResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const updatePetsHandlers = factory.createHandlers( 9 | zValidator('json', updatePetsBody), 10 | zValidator('response', updatePetsResponse), 11 | async (c: UpdatePetsContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono'; 2 | 3 | const app = new Hono(); 4 | 5 | app.get('/', (c) => { 6 | return c.text('Hello Hono!'); 7 | }); 8 | 9 | export default app; 10 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "strict": true, 7 | "skipLibCheck": true, 8 | "lib": ["ESNext"], 9 | "types": ["@cloudflare/workers-types/2023-07-01"], 10 | "jsx": "react-jsx", 11 | "jsxImportSource": "hono/jsx" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/hono-app/wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "hono" 2 | compatibility_date = "2024-08-24" 3 | 4 | # [vars] 5 | # MY_VAR = "my-variable" 6 | 7 | # [[kv_namespaces]] 8 | # binding = "MY_KV_NAMESPACE" 9 | # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 10 | 11 | # [[r2_buckets]] 12 | # binding = "MY_BUCKET" 13 | # bucket_name = "my-bucket" 14 | 15 | # [[d1_databases]] 16 | # binding = "DB" 17 | # database_name = "my-database" 18 | # database_id = "" 19 | 20 | # [ai] 21 | # binding = "AI" -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/hono/hono-with-fetch-client/next-app/app/favicon.ico -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBodyItem'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | id: number; 10 | name: string; 11 | tag: string; 12 | } 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/page.tsx: -------------------------------------------------------------------------------- 1 | import Pets from './pets'; 2 | 3 | export default function Home() { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/app/pets.tsx: -------------------------------------------------------------------------------- 1 | import { listPets } from './gen/pets/pets'; 2 | 3 | export default async function Pets() { 4 | const { data: pets, status } = await listPets(); 5 | 6 | return ( 7 |
8 |

Pets by server actions

9 | 10 |
    11 | {pets.map((pet) => ( 12 |
  • tag: {pet.tag}
  • 13 | ))} 14 |
15 | 16 |

Status: {status}

17 |
18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/next-app/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /samples/hono/hono-with-fetch-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hono-with-fetch-client", 3 | "packageManager": "yarn@4.2.2", 4 | "version": "0.1.0", 5 | "private": true, 6 | "scripts": { 7 | "generate-api": "node ../../../packages/orval/dist/bin/orval.js" 8 | }, 9 | "devDependencies": { 10 | "orval": "link:../../../packages/orval/dist" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .wrangler 4 | .dev.vars 5 | 6 | # Change them to your taste: 7 | package-lock.json 8 | yarn.lock 9 | pnpm-lock.yaml 10 | bun.lockb -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ``` 7 | npm run deploy 8 | ``` 9 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/handlers/createPets.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { CreatePetsContext } from '../petstore.context'; 4 | import { createPetsBody, createPetsResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const createPetsHandlers = factory.createHandlers( 9 | zValidator('json', createPetsBody), 10 | zValidator('response', createPetsResponse), 11 | async (c: CreatePetsContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/handlers/listPets.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { ListPetsContext } from '../petstore.context'; 4 | import { listPetsQueryParams, listPetsResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const listPetsHandlers = factory.createHandlers( 9 | zValidator('query', listPetsQueryParams), 10 | zValidator('response', listPetsResponse), 11 | async (c: ListPetsContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/handlers/showPetById.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { ShowPetByIdContext } from '../petstore.context'; 4 | import { showPetByIdParams, showPetByIdResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const showPetByIdHandlers = factory.createHandlers( 9 | zValidator('param', showPetByIdParams), 10 | zValidator('response', showPetByIdResponse), 11 | async (c: ShowPetByIdContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/handlers/updatePets.ts: -------------------------------------------------------------------------------- 1 | import { createFactory } from 'hono/factory'; 2 | import { zValidator } from '../petstore.validator'; 3 | import { UpdatePetsContext } from '../petstore.context'; 4 | import { updatePetsBody, updatePetsResponse } from '../petstore.zod'; 5 | 6 | const factory = createFactory(); 7 | 8 | export const updatePetsHandlers = factory.createHandlers( 9 | zValidator('json', updatePetsBody), 10 | zValidator('response', updatePetsResponse), 11 | async (c: UpdatePetsContext) => {}, 12 | ); 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono'; 2 | import app from './petstore'; 3 | 4 | export default app; 5 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/src/mutators.ts: -------------------------------------------------------------------------------- 1 | export const stripNill = (object: unknown) => 2 | !!object && typeof object === 'object' && !Array.isArray(object) 3 | ? Object.fromEntries( 4 | Object.entries(object).filter( 5 | ([_, value]) => value !== null && value !== undefined, 6 | ), 7 | ) 8 | : object; 9 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "node", 6 | "strict": true, 7 | "lib": ["ESNext"], 8 | "types": ["@cloudflare/workers-types"], 9 | "jsx": "react-jsx", 10 | "jsxImportSource": "hono/jsx" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/hono/hono-with-zod/wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "hono" 2 | compatibility_date = "2023-12-01" 3 | 4 | # [vars] 5 | # MY_VARIABLE = "production_value" 6 | 7 | # [[kv_namespaces]] 8 | # binding = "MY_KV_NAMESPACE" 9 | # id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 10 | 11 | # [[r2_buckets]] 12 | # binding = "MY_BUCKET" 13 | # bucket_name = "my-bucket" 14 | 15 | # [[d1_databases]] 16 | # binding = "DB" 17 | # database_name = "my-database" 18 | # database_id = "" 19 | -------------------------------------------------------------------------------- /samples/mcp/petstore/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.{js,json,yml}] 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 2 11 | -------------------------------------------------------------------------------- /samples/mcp/petstore/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG NODE_IMAGE=node:22-bookworm-slim 2 | 3 | FROM $NODE_IMAGE 4 | EXPOSE 3000 5 | WORKDIR /app 6 | COPY . /app 7 | RUN corepack enable 8 | RUN yarn install --frozen-lockfile 9 | CMD ["yarn", "dev"] 10 | -------------------------------------------------------------------------------- /samples/mcp/petstore/orval.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'orval'; 2 | 3 | export default defineConfig({ 4 | mcp: { 5 | input: { 6 | target: './petstore.yaml', 7 | }, 8 | output: { 9 | mode: 'single', 10 | client: 'mcp', 11 | baseUrl: 'https://petstore3.swagger.io/api/v3', 12 | target: 'src/handlers.ts', 13 | schemas: 'src/http-schemas', 14 | clean: true, 15 | }, 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/next-app-with-fetch/app/favicon.ico -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | readonly petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/page.tsx: -------------------------------------------------------------------------------- 1 | import Pets from './pets'; 2 | 3 | export default function Home() { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/app/pets.tsx: -------------------------------------------------------------------------------- 1 | import { listPets } from './gen/pets/pets'; 2 | 3 | export default async function Pets() { 4 | const { data: pets, status } = await listPets(); 5 | 6 | return ( 7 |
8 |

Pets by server actions

9 | 10 |
    11 | {pets.map((pet) => ( 12 |
  • {pet.name}
  • 13 | ))} 14 |
15 | 16 |

Status: {status}

17 |
18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /samples/next-app-with-fetch/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /samples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "samples", 3 | "version": "1.0.0", 4 | "private": true, 5 | "workspaces": [ 6 | "./**/*", 7 | "!mcp/**/*", 8 | "!./node_modules" 9 | ], 10 | "devDependencies": { 11 | "turbo": "^1.13.3" 12 | }, 13 | "scripts": { 14 | "generate-api": "turbo run generate-api", 15 | "test": "turbo test --filter=!react-query-form-data --filter=!react-query-form-url-encoded --filter=!react-query-form-url-encoded-mutator --filter=!react-query-form-data-mutator --filter=!react-query-hook-mutator" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app-with-swr/basic/public/favicon.ico -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app-with-swr/basic/public/logo192.png -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app-with-swr/basic/public/logo512.png -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | min-height: 100vh; 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: calc(10px + 2vmin); 12 | color: black; 13 | } 14 | 15 | .App-logo { 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | '@id'?: string; 10 | id: number; 11 | name: string; 12 | tag?: string; 13 | email?: string; 14 | } 15 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/mock.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from './api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | 6 | worker.start(); 7 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/basic/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | ignorePatterns: ['dist', '.eslintrc.cjs'], 10 | parser: '@typescript-eslint/parser', 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': [ 14 | 'warn', 15 | { allowConstantExport: true }, 16 | ], 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | '@id'?: string; 10 | id: number; 11 | name: string; 12 | tag?: string; 13 | email?: string; 14 | } 15 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/api/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App.tsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | , 10 | ); 11 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noEmit": true 11 | }, 12 | "include": ["vite.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-app-with-swr/fetch-client/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }); 8 | -------------------------------------------------------------------------------- /samples/react-app/.env.development: -------------------------------------------------------------------------------- 1 | REACT_APP_API_MODE=mock -------------------------------------------------------------------------------- /samples/react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /samples/react-app/docs-html-plugin/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /samples/react-app/docs-html-plugin/assets/hierarchy.js: -------------------------------------------------------------------------------- 1 | window.hierarchyData = 'eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg=='; 2 | -------------------------------------------------------------------------------- /samples/react-app/docs-html-plugin/assets/navigation.js: -------------------------------------------------------------------------------- 1 | window.navigationData = 2 | 'eJyN0E0LgkAQBuD/MmfJkjTyaHQIOix1jA6LjijpKrsjJdF/D/vwc9Ou+877MDunOxDeCFzYSplJMCDnFIELsSCUIfdRma9kFlGagAGXWATgWrbzMOoqQ9IWGdJYbSOREzIk5WVB2QhU5qjMbtpz5uvVwra01gFVkdBv7Z1PeftYUTXNuOSp6mvd9F9Lv1k3nbKqyb5QvU31jlF2ZUheuQv0awwGpkS/vmhDhYXwKc6EMpu06zjLFpF8vq4DvtlIXTUr64RWPEDOTxyC/r4='; 3 | -------------------------------------------------------------------------------- /samples/react-app/docs-html/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /samples/react-app/docs-html/assets/hierarchy.js: -------------------------------------------------------------------------------- 1 | window.hierarchyData = 'eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg=='; 2 | -------------------------------------------------------------------------------- /samples/react-app/docs-html/assets/navigation.js: -------------------------------------------------------------------------------- 1 | window.navigationData = 2 | 'eJyN0E0LgkAQBuD/MmfJkjTyaHQIOix1jA6LjijpKrsjJdF/D/vwc9Ou+877MDunOxDeCFzYSplJMCDnFIELsSCUIfdRma9kFlGagAGXWATgWrbzMOoqQ9IWGdJYbSOREzIk5WVB2QhU5qjMbtpz5uvVwra01gFVkdBv7Z1PeftYUTXNuOSp6mvd9F9Lv1k3nbKqyb5QvU31jlF2ZUheuQv0awwGpkS/vmhDhYXwKc6EMpu06zjLFpF8vq4DvtlIXTUr64RWPEDOTxyC/r4='; 3 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/functions/showPetById.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / showPetById 6 | 7 | # Function: showPetById() 8 | 9 | > **showPetById**\<`TData`\>(`petId`, `options`?): `Promise`\<`TData`\> 10 | 11 | ## Type Parameters 12 | 13 | • **TData** = `AxiosResponse`\<[`Pet`](../interfaces/Pet.md), `any`\> 14 | 15 | ## Parameters 16 | 17 | ### petId 18 | 19 | `string` 20 | 21 | ### options? 22 | 23 | `AxiosRequestConfig`\<`any`\> 24 | 25 | ## Returns 26 | 27 | `Promise`\<`TData`\> 28 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/interfaces/Error.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / Error 6 | 7 | # Interface: Error 8 | 9 | ## Properties 10 | 11 | ### code 12 | 13 | > **code**: `number` 14 | 15 | --- 16 | 17 | ### message 18 | 19 | > **message**: `string` 20 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/interfaces/Pet.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / Pet 6 | 7 | # Interface: Pet 8 | 9 | ## Properties 10 | 11 | ### id 12 | 13 | > **id**: `number` 14 | 15 | --- 16 | 17 | ### name 18 | 19 | > **name**: `string` 20 | 21 | --- 22 | 23 | ### tag? 24 | 25 | > `optional` **tag**: `string` 26 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/CreatePetsBody.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / CreatePetsBody 6 | 7 | # Type Alias: CreatePetsBody 8 | 9 | > **CreatePetsBody**: `object` 10 | 11 | ## Type declaration 12 | 13 | ### name 14 | 15 | > **name**: `string` 16 | 17 | ### tag 18 | 19 | > **tag**: `string` 20 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/CreatePetsResult.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / CreatePetsResult 6 | 7 | # Type Alias: CreatePetsResult 8 | 9 | > **CreatePetsResult**: `AxiosResponse`\<`void`\> 10 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/ListPetsParams.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / ListPetsParams 6 | 7 | # Type Alias: ListPetsParams 8 | 9 | > **ListPetsParams**: `object` 10 | 11 | ## Type declaration 12 | 13 | ### limit? 14 | 15 | > `optional` **limit**: `string` 16 | 17 | How many items to return at one time (max 100) 18 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/ListPetsResult.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / ListPetsResult 6 | 7 | # Type Alias: ListPetsResult 8 | 9 | > **ListPetsResult**: `AxiosResponse`\<[`Pets`](Pets.md)\> 10 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/Pets.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / Pets 6 | 7 | # Type Alias: Pets 8 | 9 | > **Pets**: [`Pet`](../interfaces/Pet.md)[] 10 | -------------------------------------------------------------------------------- /samples/react-app/docs-markdown/type-aliases/ShowPetByIdResult.md: -------------------------------------------------------------------------------- 1 | [**react-app**](../README.md) 2 | 3 | --- 4 | 5 | [react-app](../README.md) / ShowPetByIdResult 6 | 7 | # Type Alias: ShowPetByIdResult 8 | 9 | > **ShowPetByIdResult**: `AxiosResponse`\<[`Pet`](../interfaces/Pet.md)\> 10 | -------------------------------------------------------------------------------- /samples/react-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app/public/favicon.ico -------------------------------------------------------------------------------- /samples/react-app/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app/public/logo192.png -------------------------------------------------------------------------------- /samples/react-app/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-app/public/logo512.png -------------------------------------------------------------------------------- /samples/react-app/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /samples/react-app/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | min-height: 100vh; 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: calc(10px + 2vmin); 12 | color: black; 13 | } 14 | 15 | .App-logo { 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /samples/react-app/src/api/headers.ts: -------------------------------------------------------------------------------- 1 | export const getAuthHeader = (token?: string | null) => { 2 | return token 3 | ? { 4 | Authorization: `Bearer ${token}`, 5 | } 6 | : {}; 7 | }; 8 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | id: number; 10 | name: string; 11 | tag?: string; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-app/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/react-app/src/api/mutator/custom-instance.ts: -------------------------------------------------------------------------------- 1 | import Axios, { AxiosRequestConfig } from 'axios'; 2 | 3 | export const AXIOS_INSTANCE = Axios.create({ baseURL: '' }); 4 | 5 | export const customInstance = (config: AxiosRequestConfig): Promise => { 6 | return AXIOS_INSTANCE(config).then(({ data }) => data); 7 | }; 8 | 9 | export default customInstance; 10 | -------------------------------------------------------------------------------- /samples/react-app/src/api/useApi.ts: -------------------------------------------------------------------------------- 1 | import * as api from './endpoints/petstoreFromFileSpecWithTransformer'; 2 | 3 | export const useApi = () => api; 4 | -------------------------------------------------------------------------------- /samples/react-app/src/api/utilities.ts: -------------------------------------------------------------------------------- 1 | export const createApiError = (error?: T): T => { 2 | return { 3 | code: 'INTERNALSERVERERROR', 4 | message: '', 5 | ...error, 6 | } as any as T; 7 | }; 8 | -------------------------------------------------------------------------------- /samples/react-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-app/src/mock.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from './api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | 6 | worker.start(); 7 | -------------------------------------------------------------------------------- /samples/react-app/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-app/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /samples/react-query/basic/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /samples/react-query/basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/basic/public/favicon.ico -------------------------------------------------------------------------------- /samples/react-query/basic/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/basic/public/logo192.png -------------------------------------------------------------------------------- /samples/react-query/basic/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/basic/public/logo512.png -------------------------------------------------------------------------------- /samples/react-query/basic/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | min-height: 100vh; 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: calc(10px + 2vmin); 12 | color: black; 13 | } 14 | 15 | .App-logo { 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/createPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CreatePetsSort } from './createPetsSort'; 8 | 9 | export type CreatePetsParams = { 10 | /** 11 | * How many items to return at one time (max 100) 12 | */ 13 | limit?: string; 14 | /** 15 | * Which property to sort by? 16 | Example: name sorts ASC while -name sorts DESC. 17 | 18 | */ 19 | sort: CreatePetsSort; 20 | }; 21 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/createPetsSort.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsSort = 9 | (typeof CreatePetsSort)[keyof typeof CreatePetsSort]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const CreatePetsSort = { 13 | name: 'name', 14 | '-name': '-name', 15 | email: 'email', 16 | '-email': '-email', 17 | } as const; 18 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/getPetFileById404.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type GetPetFileById404 = { 9 | test?: string; 10 | }; 11 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/listPetsSort.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsSort = (typeof ListPetsSort)[keyof typeof ListPetsSort]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const ListPetsSort = { 12 | name: 'name', 13 | '-name': '-name', 14 | email: 'email', 15 | '-email': '-email', 16 | } as const; 17 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.7.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/api/model/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/mock.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from './api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | 6 | worker.start(); 7 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-query/basic/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/custom-client/public/favicon.ico -------------------------------------------------------------------------------- /samples/react-query/custom-client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/custom-client/public/logo192.png -------------------------------------------------------------------------------- /samples/react-query/custom-client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/react-query/custom-client/public/logo512.png -------------------------------------------------------------------------------- /samples/react-query/custom-client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-header { 6 | min-height: 100vh; 7 | display: flex; 8 | flex-direction: column; 9 | align-items: center; 10 | justify-content: center; 11 | font-size: calc(10px + 2vmin); 12 | color: black; 13 | } 14 | 15 | .App-logo { 16 | width: 100%; 17 | } 18 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/api/model/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/mock.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from './api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | 6 | worker.start(); 7 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-query/custom-client/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom/extend-expect'; 6 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | ignorePatterns: ['dist', '.eslintrc.cjs'], 10 | parser: '@typescript-eslint/parser', 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': [ 14 | 'warn', 15 | { allowConstantExport: true }, 16 | ], 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/App.tsx: -------------------------------------------------------------------------------- 1 | import './App.css'; 2 | 3 | import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; 4 | import Pets from './pets'; 5 | 6 | function App() { 7 | const queryClient = new QueryClient(); 8 | 9 | return ( 10 | 11 |
12 | 13 |
14 |
15 | ); 16 | } 17 | 18 | export default App; 19 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | readonly petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App.tsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | , 10 | ); 11 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noEmit": true 11 | }, 12 | "include": ["vite.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /samples/react-query/custom-fetch/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }); 8 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/custom-form-data.ts: -------------------------------------------------------------------------------- 1 | export const customFormData = (body: Body): FormData => { 2 | const formData = new FormData(); 3 | 4 | Object.entries(body).forEach(([key, value]) => { 5 | formData.append(key, value); 6 | }); 7 | 8 | return formData; 9 | }; 10 | 11 | export default customFormData; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data-mutator/models/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-data/models/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-data/orval.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'orval'; 2 | 3 | export default defineConfig({ 4 | petstore: { 5 | output: { 6 | target: './endpoints.ts', 7 | schemas: './models', 8 | client: 'react-query', 9 | prettier: true, 10 | override: { 11 | mutator: { 12 | path: './custom-instance.ts', 13 | name: 'customInstance', 14 | }, 15 | }, 16 | }, 17 | input: { 18 | target: './petstore.yaml', 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/custom-form-url-encoded.ts: -------------------------------------------------------------------------------- 1 | export const customFormUrlEncoded = (body: Body): URLSearchParams => { 2 | const formData = new URLSearchParams(); 3 | 4 | Object.entries(body).forEach(([key, value]) => { 5 | formData.append(key, value); 6 | }); 7 | 8 | return formData; 9 | }; 10 | 11 | export default customFormUrlEncoded; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded-mutator/models/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/models/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/form-url-encoded/orval.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'orval'; 2 | 3 | export default defineConfig({ 4 | petstore: { 5 | output: { 6 | target: './endpoints.ts', 7 | schemas: './models', 8 | client: 'react-query', 9 | prettier: true, 10 | override: { 11 | mutator: { 12 | path: './custom-instance.ts', 13 | name: 'customInstance', 14 | }, 15 | }, 16 | }, 17 | input: { 18 | target: './petstore.yaml', 19 | }, 20 | }, 21 | }); 22 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsNestedArrayParams'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './petCallingCode'; 14 | export * from './petCountry'; 15 | export * from './petsArray'; 16 | export * from './petsNestedArray'; 17 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/listPetsNestedArrayParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsNestedArrayParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/petsArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | /** 10 | * @minItems 1 11 | * @maxItems 20 12 | */ 13 | export type PetsArray = Pet[]; 14 | -------------------------------------------------------------------------------- /samples/react-query/hook-mutator/models/petsNestedArray.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export interface PetsNestedArray { 10 | data?: Pet[]; 11 | } 12 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/.eslintignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | vite.config.js.timestamp-* 10 | vite.config.ts.timestamp-* 11 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './error'; 10 | export * from './listPetsParams'; 11 | export * from './pet'; 12 | export * from './pets'; 13 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Pet { 9 | id: number; 10 | name: string; 11 | tag?: string; 12 | } 13 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/api/mutator/custom-instance.ts: -------------------------------------------------------------------------------- 1 | import type { AxiosRequestConfig } from 'axios'; 2 | import Axios from 'axios'; 3 | 4 | export const AXIOS_INSTANCE = Axios.create({ baseURL: '' }); 5 | 6 | export const customInstance = (config: AxiosRequestConfig): Promise => { 7 | return AXIOS_INSTANCE(config).then(({ data }) => data); 8 | }; 9 | 10 | export default customInstance; 11 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/app.d.ts: -------------------------------------------------------------------------------- 1 | // See https://kit.svelte.dev/docs/types#app 2 | // for information about these interfaces 3 | declare global { 4 | namespace App { 5 | // interface Error {} 6 | // interface Locals {} 7 | // interface PageData {} 8 | // interface Platform {} 9 | } 10 | } 11 | 12 | export {}; 13 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/mocks/browser.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from '../api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | export const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/mocks/index.ts: -------------------------------------------------------------------------------- 1 | if (typeof window === 'undefined') { 2 | import('./server').then(({ server }) => 3 | server.listen({ onUnhandledRequest: 'bypass' }), 4 | ); 5 | } else { 6 | import('./browser').then(({ worker }) => 7 | worker.start({ onUnhandledRequest: 'bypass' }).catch(console.warn), 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/mocks/server.ts: -------------------------------------------------------------------------------- 1 | import { setupServer } from 'msw/node'; 2 | import { getSwaggerPetstoreMock } from '../api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | export const server = setupServer(...getSwaggerPetstoreMock()); 5 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/routes/+layout.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/src/routes/+page.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/svelte-query/basic/static/favicon.png -------------------------------------------------------------------------------- /samples/svelte-query/basic/svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-auto'; 2 | import { vitePreprocess } from '@sveltejs/kit/vite'; 3 | 4 | /** @type {import('@sveltejs/kit').Config} */ 5 | const config = { 6 | // Consult https://kit.svelte.dev/docs/integrations#preprocessors 7 | // for more information about preprocessors 8 | preprocess: vitePreprocess(), 9 | 10 | kit: { 11 | adapter: adapter(), 12 | }, 13 | }; 14 | 15 | export default config; 16 | -------------------------------------------------------------------------------- /samples/svelte-query/basic/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | plugins: [sveltekit()], 6 | }); 7 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["svelte.svelte-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Svelte + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/App.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 |
10 | 11 |

Vite + Svelte with fetch api

12 | 13 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | readonly petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/lib/Counter.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/main.ts: -------------------------------------------------------------------------------- 1 | import './app.css'; 2 | import App from './App.svelte'; 3 | 4 | const app = new App({ 5 | target: document.getElementById('app')!, 6 | }); 7 | 8 | export default app; 9 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/svelte.config.js: -------------------------------------------------------------------------------- 1 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; 2 | 3 | export default { 4 | // Consult https://svelte.dev/docs#compile-time-svelte-preprocess 5 | // for more information about preprocessors 6 | preprocess: vitePreprocess(), 7 | }; 8 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "strict": true, 9 | "noEmit": true 10 | }, 11 | "include": ["vite.config.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /samples/svelte-query/custom-fetch/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import { svelte } from '@sveltejs/vite-plugin-svelte'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [svelte()], 7 | }); 8 | -------------------------------------------------------------------------------- /samples/swr-with-zod/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | ignorePatterns: ['dist', '.eslintrc.cjs'], 10 | parser: '@typescript-eslint/parser', 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': [ 14 | 'warn', 15 | { allowConstantExport: true }, 16 | ], 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /samples/swr-with-zod/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/swr-with-zod/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | readonly petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import App from './App.tsx'; 4 | import './index.css'; 5 | 6 | ReactDOM.createRoot(document.getElementById('root')!).render( 7 | 8 | 9 | , 10 | ); 11 | -------------------------------------------------------------------------------- /samples/swr-with-zod/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/swr-with-zod/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/swr-with-zod/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noEmit": true 11 | }, 12 | "include": ["vite.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /samples/swr-with-zod/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }); 8 | -------------------------------------------------------------------------------- /samples/turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "pipeline": { 4 | "generate-api": {}, 5 | "test": { 6 | "dependsOn": ["generate-api"] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/cat.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { CatType } from './catType'; 8 | 9 | export interface Cat { 10 | readonly petsRequested?: number; 11 | type: CatType; 12 | } 13 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/catType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CatType = (typeof CatType)[keyof typeof CatType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const CatType = { 12 | cat: 'cat', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/createPetsBodyItem.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBodyItem = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/dachshund.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DachshundBreed } from './dachshundBreed'; 8 | 9 | export interface Dachshund { 10 | length: number; 11 | breed: DachshundBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/dachshundBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DachshundBreed = 9 | (typeof DachshundBreed)[keyof typeof DachshundBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DachshundBreed = { 13 | Dachshund: 'Dachshund', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/dog.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Labradoodle } from './labradoodle'; 8 | import type { Dachshund } from './dachshund'; 9 | import type { DogType } from './dogType'; 10 | 11 | export type Dog = 12 | | (Labradoodle & { 13 | barksPerMinute?: number; 14 | type: DogType; 15 | }) 16 | | (Dachshund & { 17 | barksPerMinute?: number; 18 | type: DogType; 19 | }); 20 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/dogType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DogType = (typeof DogType)[keyof typeof DogType]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const DogType = { 12 | dog: 'dog', 13 | } as const; 14 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/labradoodle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { LabradoodleBreed } from './labradoodleBreed'; 8 | 9 | export interface Labradoodle { 10 | cuteness: number; 11 | breed: LabradoodleBreed; 12 | } 13 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/labradoodleBreed.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type LabradoodleBreed = 9 | (typeof LabradoodleBreed)[keyof typeof LabradoodleBreed]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const LabradoodleBreed = { 13 | Labradoodle: 'Labradoodle', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/petCallingCode.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCallingCode = 9 | (typeof PetCallingCode)[keyof typeof PetCallingCode]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const PetCallingCode = { 13 | '+33': '+33', 14 | '+420': '+420', 15 | } as const; 16 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/petCountry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type PetCountry = (typeof PetCountry)[keyof typeof PetCountry]; 9 | 10 | // eslint-disable-next-line @typescript-eslint/no-redeclare 11 | export const PetCountry = { 12 | "People's_Republic_of_China": "People's Republic of China", 13 | Uruguay: 'Uruguay', 14 | } as const; 15 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/gen/models/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import './style.css'; 3 | 4 | import { VueQueryPlugin } from '@tanstack/vue-query'; 5 | import App from './App.vue'; 6 | 7 | createApp(App).use(VueQueryPlugin).mount('#app'); 8 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [], 3 | "references": [ 4 | { 5 | "path": "./tsconfig.app.json" 6 | }, 7 | { 8 | "path": "./tsconfig.node.json" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 5 | "skipLibCheck": true, 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "strict": true, 10 | "noEmit": true 11 | }, 12 | "include": ["vite.config.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /samples/vue-query/custom-fetch/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import vue from '@vitejs/plugin-vue'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }); 8 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orval-labs/orval/725e6a61adec89f9a6a00dc5b2b41e59e7aa7789/samples/vue-query/vue-query-basic/public/favicon.ico -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/createPetsBody.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type CreatePetsBody = { 9 | name: string; 10 | tag: string; 11 | }; 12 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/domainStatusEnum.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type DomainStatusEnum = 9 | (typeof DomainStatusEnum)[keyof typeof DomainStatusEnum]; 10 | 11 | // eslint-disable-next-line @typescript-eslint/no-redeclare 12 | export const DomainStatusEnum = { 13 | new: 'new', 14 | sold: 'sold', 15 | uknown: 'uknown', 16 | } as const; 17 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/error.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export interface Error { 9 | code: number; 10 | message: string; 11 | } 12 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export * from './createPetsBody'; 9 | export * from './domainStatusEnum'; 10 | export * from './error'; 11 | export * from './listPetsParams'; 12 | export * from './pet'; 13 | export * from './pets'; 14 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/listPetsParams.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | 8 | export type ListPetsParams = { 9 | /** 10 | * How many items to return at one time (max 100) 11 | */ 12 | limit?: string; 13 | /** 14 | * Something that goes in the URL query and isn't limit 15 | */ 16 | filter?: string; 17 | }; 18 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/pet.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { DomainStatusEnum } from './domainStatusEnum'; 8 | 9 | export interface Pet { 10 | id: number; 11 | name: string; 12 | tag?: string; 13 | status?: DomainStatusEnum; 14 | email?: string; 15 | } 16 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/api/model/pets.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated by orval v7.9.0 🍺 3 | * Do not edit manually. 4 | * Swagger Petstore 5 | * OpenAPI spec version: 1.0.0 6 | */ 7 | import type { Pet } from './pet'; 8 | 9 | export type Pets = Pet[]; 10 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/components/tests/url-encode.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const SELECT_PET_ID_EVENT = 'onSelectPetId' as const; 2 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import App from './App.vue'; 3 | import { VueQueryPlugin } from '@tanstack/vue-query'; 4 | 5 | // NEW 6 | if (process.env.NODE_ENV === 'development') { 7 | import('./mock'); 8 | } 9 | 10 | const app = createApp(App); 11 | app.use(VueQueryPlugin); 12 | app.mount('#app'); 13 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/mock.ts: -------------------------------------------------------------------------------- 1 | import { setupWorker } from 'msw/browser'; 2 | import { getSwaggerPetstoreMock } from './api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 3 | 4 | const worker = setupWorker(...getSwaggerPetstoreMock()); 5 | 6 | worker.start(); 7 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/mocks/handlers.ts: -------------------------------------------------------------------------------- 1 | import { getSwaggerPetstoreMock } from '../api/endpoints/petstoreFromFileSpecWithTransformer.msw'; 2 | 3 | export const handlers = [...getSwaggerPetstoreMock()]; 4 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/mocks/server.ts: -------------------------------------------------------------------------------- 1 | import { setupServer } from 'msw/node'; 2 | import { handlers } from './handlers'; 3 | 4 | // This configures a request mocking server with the given request handlers. 5 | export const server = setupServer(...handlers); 6 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | import { afterAll, afterEach, beforeAll } from 'vitest'; 2 | import { server } from './mocks/server.js'; 3 | 4 | // Establish API mocking before all tests. 5 | beforeAll(() => 6 | server.listen({ 7 | onUnhandledRequest: 'error', 8 | }), 9 | ); 10 | 11 | // Reset any request handlers that we may add during the tests, 12 | // so they don't affect other tests. 13 | afterEach(() => server.resetHandlers()); 14 | 15 | // Clean up after the tests are finished. 16 | afterAll(() => server.close()); 17 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import { DefineComponent } from 'vue'; 3 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 4 | const component: DefineComponent<{}, {}, any>; 5 | export default component; 6 | } 7 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "moduleResolution": "node", 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"] 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 15 | "exclude": ["**/*.test-d.ts"] 16 | } 17 | -------------------------------------------------------------------------------- /samples/vue-query/vue-query-basic/vite.config.ts: -------------------------------------------------------------------------------- 1 | import vue from '@vitejs/plugin-vue'; 2 | import { defineConfig } from 'vite'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | optimizeDeps: { 8 | include: ['axios'], 9 | }, 10 | test: { 11 | environment: 'jsdom', 12 | setupFiles: ['src/setupTests.ts'], 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /tests/configs/mcp.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'orval'; 2 | 3 | export default defineConfig({ 4 | petstoreSingle: { 5 | input: '../specifications/petstore.yaml', 6 | output: { 7 | target: '../generated/mcp/single/handlers.ts', 8 | schemas: '../generated/mcp/single/http-schemas', 9 | mode: 'single', 10 | client: 'mcp', 11 | }, 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /tests/configs/multi-file.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'orval'; 2 | 3 | export default defineConfig({ 4 | api: { 5 | input: '../specifications/multi-files/api.yaml', 6 | output: '../generated/multi-files/api/endpoints.ts', 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /tests/mutators/custom-form-data.ts: -------------------------------------------------------------------------------- 1 | export const customFormData = >( 2 | body: Body, 3 | ): FormData => { 4 | const formData = new FormData(); 5 | 6 | Object.entries(body).forEach(([key, value]) => { 7 | formData.append(key, value); 8 | }); 9 | 10 | return formData; 11 | }; 12 | 13 | export default customFormData; 14 | -------------------------------------------------------------------------------- /tests/mutators/custom-form-url-encoded.ts: -------------------------------------------------------------------------------- 1 | export const customFormUrlEncoded = >( 2 | body: Body, 3 | ): URLSearchParams => { 4 | const formData = new URLSearchParams(); 5 | 6 | Object.entries(body).forEach(([key, value]) => { 7 | formData.append(key, value); 8 | }); 9 | 10 | return formData; 11 | }; 12 | 13 | export default customFormUrlEncoded; 14 | -------------------------------------------------------------------------------- /tests/mutators/response-type.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosRequestConfig } from 'axios'; 2 | 3 | export const getWithResponseType = ( 4 | config: AxiosRequestConfig, 5 | ): Promise => { 6 | return axios({ ...config, responseType: 'json' }).then(({ data }) => data); 7 | }; 8 | 9 | export default getWithResponseType; 10 | -------------------------------------------------------------------------------- /tests/mutators/test.ts: -------------------------------------------------------------------------------- 1 | import Axios, { AxiosError, AxiosRequestConfig } from 'axios'; 2 | 3 | export const AXIOS_INSTANCE = Axios.create(); 4 | 5 | export default function customInstance( 6 | config: AxiosRequestConfig, 7 | ): Promise { 8 | return AXIOS_INSTANCE({ ...config }).then(({ data }) => data); 9 | } 10 | 11 | export type ErrorType = AxiosError; 12 | -------------------------------------------------------------------------------- /tests/mutators/zod-preprocess.ts: -------------------------------------------------------------------------------- 1 | export const stripNill = (object: unknown) => 2 | !!object && typeof object === 'object' && !Array.isArray(object) 3 | ? Object.fromEntries( 4 | Object.entries(object).filter( 5 | ([_, value]) => value !== null && value !== undefined, 6 | ), 7 | ) 8 | : object; 9 | -------------------------------------------------------------------------------- /tests/regressions/arrays.ts: -------------------------------------------------------------------------------- 1 | import { ArrayTest } from '../generated/default/regressions/model/arrayTest'; 2 | 3 | // Ensure arrays with nullable items work correctly. 4 | // See: https://github.com/orval-labs/orval/pull/563 5 | const arrays: ArrayTest = { 6 | nullable_items: ['string', null], 7 | nested_nullable_items: [['string'], [null]], 8 | }; 9 | 10 | void arrays; 11 | -------------------------------------------------------------------------------- /tests/regressions/duplicateTags.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getEndpointA, 3 | getEndpointB, 4 | getEndpointC, 5 | getEndpointD, 6 | getEndpointE, 7 | } from '../generated/default/regressions/dup-tag/dup-tag'; 8 | 9 | void getEndpointA; 10 | void getEndpointB; 11 | void getEndpointC; 12 | void getEndpointD; 13 | void getEndpointE; 14 | -------------------------------------------------------------------------------- /tests/specifications/import-from-subdirectory/subdirectory/another-file.yaml: -------------------------------------------------------------------------------- 1 | components: 2 | schemas: 3 | AnotherSchema: 4 | type: object 5 | required: 6 | - id 7 | properties: 8 | id: 9 | type: integer 10 | format: int64 11 | -------------------------------------------------------------------------------- /tests/specifications/import-from-subdirectory/subdirectory/petstore.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.2 2 | info: 3 | version: 1.0.0 4 | title: Swagger Petstore 5 | components: 6 | schemas: 7 | Pet: 8 | type: object 9 | required: 10 | - id 11 | properties: 12 | id: 13 | type: integer 14 | format: int64 15 | file: 16 | $ref: 'another-file.yaml#/components/schemas/AnotherSchema' 17 | -------------------------------------------------------------------------------- /tests/specifications/multi-files/schemas/person.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.2 2 | info: 3 | title: PetStore 4 | version: 1.0.0 5 | paths: {} 6 | components: 7 | schemas: 8 | Person: 9 | type: object 10 | required: 11 | - id 12 | - name 13 | properties: 14 | id: 15 | type: string 16 | name: 17 | type: string 18 | -------------------------------------------------------------------------------- /tests/specifications/multi-files/schemas/pet.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.2 2 | info: 3 | title: PetStore 4 | version: 1.0.0 5 | paths: {} 6 | components: 7 | schemas: 8 | Pet: 9 | type: object 10 | properties: 11 | id: 12 | type: string 13 | name: 14 | type: string 15 | owner: 16 | $ref: './person.yaml#/components/schemas/Person' 17 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "pipeline": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "outputs": ["dist/**"] 7 | }, 8 | "dev": { 9 | "cache": false 10 | }, 11 | "lint": { 12 | "outputs": [] 13 | }, 14 | "test": { 15 | "outputs": [] 16 | } 17 | }, 18 | "globalEnv": ["ORVAL_DEBUG_FILTER", "CI", "DEBUG"] 19 | } 20 | -------------------------------------------------------------------------------- /types/esutils.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'esutils' { 2 | export namespace keyword { 3 | export function isIdentifierNameES5(str: string): boolean; 4 | export function isKeywordES5(id: string, strict: boolean): boolean; 5 | } 6 | } 7 | --------------------------------------------------------------------------------