Visit orval.dev for docs, guides, API and beer!
orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats.
generate models, requests, hooks, mocks and more, for these supported clients:
You can find some samples below:
- react app
- react query
- svelte query
- vue query
- react app with swr
- angular app
- hono
- next app with fetch
- mcp server
Try Orval out for yourself using our Playground application!
This project uses Yarn for package management and building. Here are the key scripts available for development:
Before using Yarn scripts, ensure you have Yarn installed. You can install it globally using npm:
npm install -g yarnAlternatively, you can enable Corepack (which comes with Node.js 16.10+) to manage Yarn:
corepack enable-
yarn nuke:all- Completely clean your workspace by removing all build artifacts, node_modules, and cached files. Use this when you want to start fresh. -
yarn 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.
-
yarn test- Run unit tests in all packages. -
yarn update-samples- Generate sample outputs using the newly built version of Orval. This regenerates the sample code based on the current build. -
yarn test:samples- Run tests in the samples directory using the newly generated output fromupdate-samples. -
yarn 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
yarn buildto compile your changes - Run
yarn testto ensure unit tests pass - Run
yarn update-samplesto regenerate sample outputs - Run
yarn test:samplesto verify samples work correctly - Run
yarn test:clito validate TypeScript compilation
If you encounter issues or want to start completely fresh:
- Run
yarn nuke:allto clean everything - Reinstall dependencies and rebuild from scratch