Roadmap
The mission of this toolchain is to be a zero-footprint bridge between OpenAPI and Zod for both sides of the wire. Every package is a devDependency or a peer-dep-only tool. Nothing published here adds bytes to a production bundle that are not already there.
This page mirrors the ROADMAP.md in the repo. The five published packages are four generators (openapi-zod-ts, @codewithagents/openapi-server, @codewithagents/openapi-react-query, @codewithagents/openapi-msw) plus one runtime helper (@codewithagents/api-errors).
| Package | Version | One-liner |
|---|---|---|
openapi-zod-ts | v2.1.0 | Core generator: TypeScript models, native fetch client, and Zod schemas from an OpenAPI 3.1 spec. CLI: openapi-zod-ts. |
@codewithagents/openapi-server | v2.0.0 | Framework-agnostic service interface plus an optional router. CLI: openapi-server. |
@codewithagents/openapi-react-query | v3.12.1 | Typed React Query v5 hooks over the generated client. |
@codewithagents/openapi-msw | v0.2.0 | MSW v2 handlers with seeded Faker mock data. CLI: openapi-msw. |
@codewithagents/api-errors | v1.2.0 | Maps backend API error responses to form-field errors. Runtime helper, not a codegen step. |
Now: shipped
Section titled “Now: shipped”@codewithagents/api-errors (v1.2.0)
Section titled “@codewithagents/api-errors (v1.2.0)”Maps backend API error responses to form field errors. Framework-agnostic core with adapters for React Hook Form, Formik, TanStack Form, and vanilla JavaScript.
Supported parsers: RFC 7807 / RFC 9457 Problem Details, Spring Boot validation errors, violations / invalid-params shapes, JSON:API error objects, Laravel and DRF error formats, flat field/message objects, GraphQL error extensions, Zod flatten output, and Axios response wrappers.
openapi-zod-ts (v2.1.0)
Section titled “openapi-zod-ts (v2.1.0)”A CLI devDependency that reads an OpenAPI 3.1 spec and an optional user-owned Zod schema, then generates self-contained TypeScript. No runtime package required. The generated client uses only native fetch. Ships the openapi-zod-ts CLI.
Core features shipped:
models.ts: TypeScript interfaces for every schema incomponents.schemasclient.ts: one typedasync functionper API operationclient-config.ts:configureClient()andgetConfig()for base URL and authindex.ts: barrel re-export of all three files- Optional Zod integration via
input_schema: bootstrapsschemas.tson first run, then validates requests and responses on every call - Optional
server.tsviaserver_client: true:createServerClient()factory for SSR - Multi-spec
projectsarray in config: drive N separate generations from one config file
@codewithagents/openapi-react-query (v3.12.1)
Section titled “@codewithagents/openapi-react-query (v3.12.1)”A separate package layered on top of openapi-zod-ts. Reads the same openapi.json and the output of the generator, then produces React Query v5 hooks.
queryOptionsfactories for GET endpointsuseMutationhooks for write operationsuseInfiniteQueryhooks for paginated endpoints- Imports from
openapi-zod-ts’sclient.tsoutput - Peer dependency:
@tanstack/react-query
@codewithagents/openapi-server (v2.0.0)
Section titled “@codewithagents/openapi-server (v2.0.0)”Server-side counterpart to openapi-zod-ts. Reads the same openapi.json and generates a framework-agnostic service interface plus an optional router selected by framework: "hono" | "express" | "fastify" | "none" (default "none", which emits only the service interface and lets you wire it to any framework yourself). Fastify is the framework the project ships its canonical full-stack app on. Ships the openapi-server CLI.
Peer dependencies: hono, express, or fastify depending on the chosen framework.
@codewithagents/openapi-msw (v0.2.0)
Section titled “@codewithagents/openapi-msw (v0.2.0)”Generates MSW v2 HTTP handlers with seeded Faker mock data from an OpenAPI 3.1 spec. Depends on openapi-zod-ts. Produces a single handlers.ts file ready to drop into a Storybook or Vitest browser setup. Ships the openapi-msw CLI.
- One
http.<method>(path, resolver)handler per operation - Faker-seeded responses derived from response schemas
- Peer dependencies:
msw(^2) and@faker-js/faker(^9)
The full-stack story
Section titled “The full-stack story”One spec drives four generators. The shared schemas.ts is the single source of validation truth across the wire.
openapi.json + schemas.ts ├── openapi-zod-ts → client validates responses with the user's Zod schemas ├── @codewithagents/openapi-server → server validates requests with the same Zod schemas ├── @codewithagents/openapi-react-query → React Query v5 hooks over the generated client └── @codewithagents/openapi-msw → MSW v2 handlers with seeded Faker mock data@codewithagents/api-errors then maps server validation failures back onto form fields in app code. The canonical end-to-end reference wiring all of this together is packages/petstore-fastify: Fastify plus createContext auth, a cross-field validation rule, and a React / react-query frontend with browser e2e that round-trips a cross-field error onto a form field. @codewithagents/petstore-hono is a retained legacy Hono variant.