Why generate Vue code, not just types
Search for “openapi to typescript” and you get a wall of CLIs and single-file converters: openapi-typescript, orval, and a few browser tools that stop at types. Search for “openapi to vue component” and you get official documentation, a GitHub template, a VS Code extension and an archived repository — no tool you can open in a tab. That gap is why this page exists.
Types alone do not give you a screen. The part that actually costs time in a Vue project is the layer above: a fetch call with path and query parameters wired up, a composable that tracks loading and error state, and a table or form that matches the schema. So this generator emits all of it in one pass:
- Types that survive real specs. Local $refs are resolved, allOf becomes an intersection, oneOf/anyOf become unions, enums become literal unions, nullable becomes | null, and additionalProperties becomes Record<string, T>. Constructs it cannot handle are reported as warnings rather than quietly emitted as any.
- A client with no runtime dependency. One function per operation, built on fetch: path parameters URI-encoded, query parameters collected, custom headers merged, and baseUrl/fetch swappable through ApiOptions so you can intercept or mock it.
- Composables, not just functions. Each operation also gets a useXxx() composable exposing data, error, loading and run() — the shape a Vue component actually consumes, with no store required.
- Components that match your schema. Collection endpoints produce a table whose default columns come from the item schema; request bodies produce a form with matching input types, selects for enums, and a typed submit payload.
Everything runs in your tab: the spec is parsed, $refs resolved and files assembled locally, so nothing is uploaded and no share link is created. That matters more than it sounds — an OpenAPI document is often the most complete description of an API that exists, including endpoints that have not shipped yet. Treat the output as a starting point rather than a finished app: review it, wire the components to your router or store, and keep the spec as the source of truth.