Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Orval - Generate type-safe API clients from OpenAPI
[go: Go Back, main page]

v8 is now available

OpenAPI to
TypeScript Magic

Transform your OpenAPI specs into type-safe clients, mocks, and validators. Stop writing boilerplate. Start shipping features.

$bun add -d orval

From Spec to Code in Seconds

Your OpenAPI specification becomes fully typed, production-ready code.

petstore.yaml
openapi: 3.0.0
info:
  title: Pet Store API
  version: 1.0.0
paths:
  /pets:
    get:
      operationId: listPets
      responses:
        200:
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Pet'
components:
  schemas:
    Pet:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
petstore.ts
import { useQuery } from '@tanstack/react-query';

export interface Pet {
  id?: number;
  name?: string;
}

export const useListPets = () => {
  return useQuery({
    queryKey: ['listPets'],
    queryFn: async () => {
      const response = await fetch('/pets');
      return response.json() as Promise<Pet[]>;
    },
  });
};

// Usage in your component
const { data: pets } = useListPets();

Why Developers Love Orval

Built by developers, for developers. Every feature designed to save you time.

🔒

Type Safety

End-to-end TypeScript types generated from your OpenAPI spec. No more runtime surprises.

Framework Native

Generate hooks for React Query, SWR, Angular, Vue, Svelte, and Solid. Use what you know.

🎭

Mock Ready

Auto-generate MSW handlers with Faker.js data. Test without a backend.

Works With Your Stack

First-class support for the tools you already use.

⚛️React Query
💚Vue Query
🔥Svelte Query
💠Solid Query
🅰️Angular
🔄SWR
📡Axios
🌐Fetch
🎭MSW
🛡️Zod
🔥Hono
🤖MCP

Thanks for the Support! 🍻

Orval is made possible by our amazing sponsors and backers.

Sponsors

MOSH, Inc.

Backers

astatsuyaunderground0930yoshinonabeenJeongmin Lee

Ready to Transform Your API Workflow?

Join thousands of developers who ship faster with Orval.