OpenAPI to Client Code Generator

Paste or open an OpenAPI 3 or Swagger 2 document and get typed models, a client class and call examples in TypeScript, Python and Go.

브라우저에서 실행됩니다. 파일은 기기 밖으로 나가지 않습니다. 확인하는 방법 보기

…

사용 방법

  1. 1
    Load the description

    Press Open OpenAPI file, paste YAML or JSON into the document box, or press Load sample.

  2. 2
    Check the summary

    Read the API name, number of operations and models, auth type and any warnings.

  3. 3
    Name things

    Set the class name, Go package and an optional base URL.

  4. 4
    Read the clients

    Open TypeScript, Python and Go to read and copy the generated code.

  5. 5
    Try an operation

    Open Examples per operation, pick an operation and copy the call in your language or curl.

  6. 6
    Download everything

    Press Download all (ZIP) for the three clients, README and EXAMPLES.md.

이 도구 소개

When an API publishes an OpenAPI description, nobody should have to type its models by hand. Code generators exist, but they usually need Java or Docker, produce dozens of files and pull in runtime libraries. This generator works in the browser and writes one readable file per language with no dependencies beyond the usual HTTP library: a fetch-based TypeScript client with interfaces for every schema, a Python client built on requests with TypedDict models, and a Go client using net/http with structs and JSON tags. Every operation becomes a typed method with path, query, header and body parameters, authentication is wired from the security schemes, and each operation gets examples in TypeScript, Python, Go and curl.

Who this is for

Front-end and backend developers integrating a partner API, teams that want a lightweight internal SDK, and API designers who want to see what consumers will get from their description.

Input

OpenAPI 3.0 and 3.1 in YAML or JSON, and Swagger 2.0 (definitions, body and formData parameters, host and basePath). Local references to schemas, parameters, request bodies and responses are resolved. Inline object schemas are given names from their place in the document, for example PetOwner for the owner property of Pet, so every object becomes a real type.

What is generated

- TypeScript: interfaces and type aliases, enums as string unions, nullable as `| null`, an ApiError class and a client whose methods return typed promises. - Python: TypedDict models with NotRequired for optional fields, Literal for enums, a requests.Session based client with snake_case method names and timeouts. - Go: structs with json tags and omitempty, pointers for optional values, string enum types with constants, a Params struct for query and header parameters and context-aware methods. - README with an operation table, and EXAMPLES.md with ready calls in every language plus curl.

Authentication

The first security scheme is used: bearer tokens, HTTP basic or an API key in a header or the query string. The client takes the token or key in its options.

Worked example

For the Bookshop sample, the operation getBook with path parameter bookId becomes `getBook(bookId: string): Promise<Book>` in TypeScript, `def get_book(self, book_id: str) -> "Book"` in Python and `func (c *Client) GetBook(ctx context.Context, bookId string) (*Book, error)` in Go. The inline stock object inside Book becomes its own BookStock model in all three languages.

Limits

The output is a starting point that you own; it is not regenerated automatically when the API changes. Discriminators and complex oneOf polymorphism map to unions in TypeScript and Python and to json.RawMessage in Go. Cookie parameters, XML bodies, callbacks, webhooks and response headers are not generated. External references to other files must be bundled into one document first.

풀이 예시

getBook(bookId) → TypeScript Promise<Book>, Python get_book(book_id) -> Book, Go GetBook(ctx, bookId) (*Book, error); inline stock object → BookStock.

한눈에 보기

자주 묻는 질문

Which OpenAPI versions are supported?

OpenAPI 3.0.x and 3.1.x in YAML or JSON, and Swagger 2.0. Other files must be converted first.

Do the clients need extra libraries?

TypeScript uses the built-in fetch, Go uses only the standard library and Python needs requests and typing_extensions.

How are optional fields handled?

TypeScript marks them with ?, Python wraps them in NotRequired and Go uses pointers with omitempty so that missing values are not sent.

What happens with inline objects?

They are hoisted to named models based on where they appear, such as PetOwner or CreatePetRequest, so you can import and reuse them.

Can I change the base URL?

Yes. Set Base URL in the tool, or pass baseUrl, base_url or BaseURL when you create the client at run time.

Is my API description uploaded?

No. Parsing and generation run in your browser; the document is saved only in local storage.

완전 무료요금 없음, 가입 없음
파일은 비공개로 유지됩니다모든 작업이 브라우저 안에서 이루어집니다
내 언어로 쉽게여러 언어로 제공