Generate type-safe TypeScript clients from OpenAPI or Swagger specifications for various frameworks.
Orval is a code generation tool that creates type-safe JavaScript clients from OpenAPI v3 or Swagger v2 specifications. It automates the creation of models, requests, hooks, and mocks to help developers build robust and error-free API integrations.
Frontend and full-stack developers working with TypeScript in frameworks like React, Vue, Svelte, Solid, Angular, or Hono who need to integrate with RESTful APIs defined by OpenAPI/Swagger specifications.
Developers choose Orval for its comprehensive framework integration, generating fully typed clients that match the API specification, and its ability to produce mock data and integrate with popular query libraries like TanStack Query and SWR, reducing manual work and preventing integration errors.
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. 🍺
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates clients for React, Vue, Svelte, Solid, Angular, Hono, and more, as listed in the README, making it highly adaptable to diverse tech stacks.
Produces fully typed TypeScript clients that match the API specification, reducing integration errors and improving developer experience.
Can generate mock data using MSW, facilitating testing and development without needing a live API, as highlighted in the features.
Integrates with popular libraries like TanStack Query and SWR, enhancing data fetching capabilities in supported frameworks.
Version 8.0.0+ introduced significant changes requiring a migration guide, which can disrupt existing projects during upgrades and add maintenance overhead.
The effectiveness of generated clients hinges on accurate and complete OpenAPI specifications; poor or outdated specs lead to flawed or incomplete code.
Setting up Orval requires configuration files and understanding of options, which might be overkill for very simple APIs or rapid prototyping.