orval generates type-safe JS clients (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats.
Important
Version 8.0.0+ comes with a lot of improvements and changes please see the Migration Guide
generate models, requests, hooks, mocks and more, for these supported clients:
- React
- React Query
- React with swr
- Vue Query
- Svelte Query
- Solid Query
- SolidStart
- Angular
- Angular Query
- Hono
- zod
- native fetch
- mcp
You can find some samples below:
- react app
- react query
- svelte query
- vue query
- solid query
- solid start
- react app with swr
- angular app
- angular query
- hono
- next app with fetch
- mcp server
Try Orval out for yourself using our Playground application!
First of all, we do not reject the use of AI agents outright. That said, please do not submit AI-generated output in a PR without reviewing it yourself. Every change must have a clear intent and purpose — do not submit changes you cannot explain in your own words. Making the effort to understand orval's codebase, TypeScript, and API clients beforehand, and reviewing what AI produces, is the contributor's responsibility, not the reviewer's. Finally, we will continue to welcome new contributors and actively support you through review and iteration.
See CONTRIBUTING.md for details.
This project uses Bun for package management and building. Bun install guide.
-
bun run nuke:all- Completely clean your workspace by removing all build artifacts, node_modules, and cached files. Use this when you want to start fresh. -
bun run build- Build the project and make changes available to the workspace. Run this after making code changes to compile TypeScript and prepare the project for use. -
bun run typecheck- Run TypeScript type checking across all packages.
-
bun run test- Run unit tests in all packages. -
bun run update-samples- Generate sample outputs using the newly built version of Orval. This regenerates the sample code based on the current build. -
bun run test:samples- Run tests in the samples directory using the newly generated output fromupdate-samples. -
bun run test:snapshots- Run snapshot tests to verify generated sample outputs match the committed snapshots. Fails if any generated file differs from its snapshot. -
bun run test:snapshots:update- Regenerate snapshot files to match the current generated output. Run this afterbun run update-sampleswhen the generated output has intentionally changed. -
bun run test:cli- Test that the generated output (not samples) is valid TypeScript. This validates the TypeScript compilation of the generated code.
A typical development workflow would be:
- Make your code changes
- Run
bun run buildto compile your changes - Run
bun run typecheckto verify package typings - Run
bun run lintto catch lint issues early - Run
bun run testto run unit tests in packages - Run
bun run test:snapshotsto verify generated output matches snapshots
If step 6 fails because the generated output has intentionally changed, run bun run test:snapshots:update to update the snapshots.
If you encounter issues or want to start completely fresh:
- Run
bun run nuke:allto clean everything - Reinstall dependencies and rebuild from scratch
Thank you to all our sponsors! 🍻
Support orval development by Open Collective and your logo will be displayed here with a link to your website.
Thank you to all our backers! 🙏
Support us with a one-time donation and help us continue our activities on Open Collective.
Note: After becoming a sponsor or backer, please contact us on Discord to upload your logo.