Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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. ๐Ÿบ

License

Notifications You must be signed in to change notification settings

orval-labs/orval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2,320 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

npm version NPM Downloads License: MIT tests orval Gurubase

orval - Restfull Client Generator

Generate Typescript clients from OpenAPI specification!

Code Generation

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

Supported clients

generate models, requests, hooks, mocks and more, for these supported clients:

Samples

You can find some samples below:

Playground

Try Orval out for yourself using our Playground application!

Developers

This project uses Yarn for package management and building. Here are the key scripts available for development:

Prerequisites

Before using Yarn scripts, ensure you have Yarn installed. You can install it globally using npm:

npm install -g yarn

Alternatively, you can enable Corepack (which comes with Node.js 16.10+) to manage Yarn:

corepack enable

Build Scripts

  • 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.

Test Scripts

  • yarn test - Run unit tests in all packages.

  • yarn test:ci - Run the CI-equivalent checks locally (lint, package tests, test:cli, and test:samples).

  • 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 from update-samples.

  • yarn test:cli - Test that the generated output (not samples) is valid TypeScript. This validates the TypeScript compilation of the generated code.

Development Workflow

A typical development workflow would be:

  1. Make your code changes
  2. Run yarn build to compile your changes
  3. Run yarn lint to catch lint issues early
  4. Run yarn test to run unit tests in packages
  5. Run yarn update-samples to regenerate sample outputs
  6. Run yarn test:samples to verify samples work correctly
  7. Run yarn test:cli to validate TypeScript compilation

Or, as a shortcut after yarn build and yarn update-samples, run yarn test:ci to execute the full local CI-equivalent validation (lint, package tests, test:cli, and test:samples) in one command.

If you encounter issues or want to start completely fresh:

  1. Run yarn nuke:all to clean everything
  2. Reinstall dependencies and rebuild from scratch

Sponsors

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.

Become a sponsor

Backers

Thank you to all our backers! ๐Ÿ™

Support us with a one-time donation and help us continue our activities on Open Collective.

Backer Backer Backer

Note: After becoming a sponsor or backer, please contact us on Discord to upload your logo.

Star History

Star History Chart

All Thanks To Our Contributors:

About

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. ๐Ÿบ

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  
  •  
  •  

Languages