MCPcopy
hub / github.com/orval-labs/orval

github.com/orval-labs/orval @v8.20.0 sqlite

repository ↗ · DeepWiki ↗ · release v8.20.0 ↗
14,673 symbols 33,001 edges 6,940 files 224 documented · 2%
README

npm version NPM Downloads License: MIT Gurubase pkg.pr.new

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!

Docker

Orval 8+ requires Node.js 22.18 or newer. Projects on an older Node LTS can run code generation with the official Docker image.

Basic usage

# macOS / Linux
docker run --rm -v "$(pwd):/app" -w /app ghcr.io/orval-labs/orval

# Windows Git Bash
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/app" -w /app ghcr.io/orval-labs/orval

# Windows CMD
cd /d "C:\path\to\your-project"
docker run --rm -v "%cd%:/app" -w /app ghcr.io/orval-labs/orval

# Windows PowerShell
cd "C:\path\to\your-project"
docker run --rm -v "${PWD}:/app" -w /app ghcr.io/orval-labs/orval

Local API (localhosthost.docker.internal)

# macOS / Linux
docker run --rm -v "$(pwd):/app" -w /app -e ORVAL_SWAGGER_URL="https://host.docker.internal:7142/swagger/v1/swagger.json" -e NODE_TLS_REJECT_UNAUTHORIZED=0 ghcr.io/orval-labs/orval --config ./orval.config.ts

# Linux (native Docker)
docker run --rm --add-host=host.docker.internal:host-gateway -v "$(pwd):/app" -w /app -e ORVAL_SWAGGER_URL="https://host.docker.internal:7142/swagger/v1/swagger.json" -e NODE_TLS_REJECT_UNAUTHORIZED=0 ghcr.io/orval-labs/orval --config ./orval.config.ts

# Windows Git Bash
MSYS_NO_PATHCONV=1 docker run --rm -v "$(pwd):/app" -w /app -e ORVAL_SWAGGER_URL="https://host.docker.internal:7142/swagger/v1/swagger.json" -e NODE_TLS_REJECT_UNAUTHORIZED=0 ghcr.io/orval-labs/orval --config ./orval.config.ts

# Windows CMD
cd /d "C:\path\to\your-project"
docker run --rm -v "%cd%:/app" -w /app -e "ORVAL_SWAGGER_URL=https://host.docker.internal:7142/swagger/v1/swagger.json" -e "NODE_TLS_REJECT_UNAUTHORIZED=0" ghcr.io/orval-labs/orval --config ./orval.config.ts

# Windows PowerShell
cd "C:\path\to\your-project"
docker run --rm -v "${PWD}:/app" -w /app -e ORVAL_SWAGGER_URL="https://host.docker.internal:7142/swagger/v1/swagger.json" -e NODE_TLS_REJECT_UNAUTHORIZED=0 ghcr.io/orval-labs/orval --config ./orval.config.ts

Replace ghcr.io/orval-labs/orval with orval:local when testing locally before the official image is published. See the installation docs for details.

A note about AI

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.

Developers

This project uses Bun for package management and building. Bun install guide.

Build Scripts

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

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

  • vp run typecheck - Run TypeScript type checking across all packages.

Test Scripts

  • vp run test - Run unit tests in all packages.

  • vp run update-samples - Generate sample outputs using the newly built version of Orval. This regenerates the sample code based on the current build.

  • vp run test:samples - Run tests in the samples directory using the newly generated output from update-samples.

  • vp run test:snapshots - Run snapshot tests to verify generated sample outputs match the committed snapshots. Fails if any generated file differs from its snapshot.

  • vp run test:snapshots:update - Regenerate snapshot files to match the current generated output. Run this after vp run update-samples when the generated output has intentionally changed.

  • vp run 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 vp run build to compile your changes
  3. Run vp run typecheck to verify package typings
  4. Run vp run lint to catch lint issues early
  5. Run vp run test to run unit tests in packages
  6. Run vp run test:snapshots to verify generated output matches snapshots

If step 6 fails because the generated output has intentionally changed, run vp run test:snapshots:update to update the snapshots.

If you encounter issues or want to start completely fresh:

  1. Run vp run 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 tatsuya-asami

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

Star History

<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=orval-labs/orval&type=Date" />

All Thanks To Our Contributors:

Extension points exported contracts — how you extend this code

AngularOperationOverride (Interface)
* Reads the per-operation angular client override from the orval config. * * Mirrors the pattern used by `@orval/query
packages/angular/src/http-resource.ts
ExtraImport (Interface)
* One sibling import the recursive TS type body needs. `name` is the export * name in the sibling file (also the basis
packages/orval/src/write-zod-specs.ts
VueReactivity (Interface)
* Vue Query v5 requires Vue 3.3+, where `MaybeRefOrGetter ` (a superset of * `MaybeRef ` that also accepts `() => T
packages/query/src/frameworks/vue.ts
ServiceWorkerGlobalScope (Interface)
* The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a se
docs/worker-configuration.d.ts
DesiredValidator (Interface)
(no doc)
packages/hono/src/handler-merge.ts
Options (Interface)
(no doc)
packages/core/src/types.ts
MockFactorySignatureParts (Interface)
(no doc)
packages/mock/src/mock-types.ts
EffectValidationSchemaDefinition (Interface)
(no doc)
packages/effect/src/index.ts

Core symbols most depended-on inside this repo

get
called by 1657
docs/worker-configuration.d.ts
text
called by 925
docs/worker-configuration.d.ts
json
called by 531
tests/__snapshots__/fetch/stream/endpoints.ts
append
called by 394
docs/worker-configuration.d.ts
toString
called by 290
docs/worker-configuration.d.ts
delete
called by 214
docs/worker-configuration.d.ts
set
called by 213
docs/worker-configuration.d.ts
json
called by 201
docs/worker-configuration.d.ts

Shape

Function 11,869
Interface 2,171
Method 430
Class 193
Enum 10

Languages

TypeScript100%

Modules by API surface

docs/worker-configuration.d.ts636 symbols
packages/core/src/types.ts95 symbols
tests/__snapshots__/react-query/mutator/endpoints.ts66 symbols
tests/__snapshots__/svelte-query/petstore/endpoints.ts62 symbols
tests/__snapshots__/react-query/invalidates/endpoints.ts60 symbols
tests/__snapshots__/vue-query/invalidates/endpoints.ts59 symbols
tests/__snapshots__/svelte-query/invalidates/endpoints.ts59 symbols
tests/__snapshots__/react-query/zod-schema-response/endpoints.ts59 symbols
tests/__snapshots__/react-query/mockWithoutDelay/endpoints.ts59 symbols
tests/__snapshots__/react-query/mockOverride/endpoints.ts59 symbols
tests/__snapshots__/react-query/http-client-fetch-with-custom-fetch/endpoints.ts59 symbols
tests/__snapshots__/react-query/basic/endpoints.ts59 symbols

Dependencies from manifests, versioned

@angular-eslint/builder22.0.0 · 1×
@angular-eslint/eslint-plugin22.0.0 · 1×
@angular-eslint/eslint-plugin-template22.0.0 · 1×
@angular-eslint/template-parser22.0.0 · 1×
@angular/buildcatalog:angular · 1×
@angular/clicatalog:angular · 1×
@angular/commoncatalog:angular · 1×
@angular/compilercatalog:angular · 1×
@angular/compiler-clicatalog:angular · 1×
@angular/corecatalog:angular · 1×
@angular/formscatalog:angular · 1×
@angular/platform-browsercatalog:angular · 1×

For agents

$ claude mcp add orval \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact