Skip to content

docs(adr): 0017 support openapi-typescript and openapi-typesafe side by side - #73

Merged
NoZiL merged 1 commit into
mainfrom
docs/adr-0015-two-generators
Nov 8, 2026
Merged

NoZiL merged 1 commit into
mainfrom
docs/adr-0015-two-generators

Conversation

@NoZiL

@NoZiL NoZiL commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

ADR 0017: support openapi-typescript and openapi-typesafe side by side.

openapi-typescript stopped receiving updates on 2026-09-19 (openapi-ts/openapi-typescript#2874). Because of that, our helpers patch (ADR 0005) is now permanent for consumers, and TypeScript 6 and 7 support (#52, #46) will never come through it.

Docs only. This PR has no code changes. The implementation is tracked in #68 (codegen), #69 (runtime), #70 (TS matrix) and #71 (docs).

Evidence

Trial on the local branch try/openapi-typesafe (not for merge): openapi-typesafe 1.0.0-rc.3 replaced all four packages via openapi-typesafe-migrate. With the patch removed, codegen, typecheck, all 41 tests and the oasdiff gate pass, including types.check.ts check 4 (open enums keep their type).

Test plan

  • pnpm lint
  • ADR index updated, and 0012's status set to superseded by 0015

🤖 Generated with Claude Code

@NoZiL NoZiL changed the title docs(adr): 0015 support openapi-typescript and openapi-typesafe side by side docs(adr): 0016 support openapi-typescript and openapi-typesafe side by side Nov 8, 2026
@NoZiL
NoZiL force-pushed the docs/adr-0015-two-generators branch from 70e5546 to f889193 Compare November 8, 2026 18:18
…by side

openapi-typescript stopped receiving updates (openapi-ts/openapi-typescript#2874).
Add openapi-typesafe as a second, opt-in generator stack: no helpers patch,
TypeScript 5.4 to 7. openapi-typescript stays the default until openapi-ts
links to the fork (#67). Supersedes 0012, amends 0005.
Work: #68 codegen, #69 runtime, #70 TS matrix, #71 docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@NoZiL
NoZiL force-pushed the docs/adr-0015-two-generators branch from f889193 to 90ede32 Compare November 8, 2026 18:19
@NoZiL NoZiL changed the title docs(adr): 0016 support openapi-typescript and openapi-typesafe side by side docs(adr): 0017 support openapi-typescript and openapi-typesafe side by side Nov 8, 2026
@NoZiL
NoZiL merged commit 85467a8 into main Nov 8, 2026
1 check passed
@NoZiL
NoZiL deleted the docs/adr-0015-two-generators branch November 8, 2026 18:20
NoZiL added a commit that referenced this pull request Nov 13, 2026
)

## What and why

Records the outcome of the #124 spike as ADR 0027 (status: **accepted**
after review).

Recommendation: support Hey API (`@hey-api/openapi-ts`) as a **third,
opt-in, experimental** stack. Don't replace either existing stack,
because Hey API's calling style is different. It amends ADR 0017. ADR
0003 (gating) holds as written: the Hey API path keeps `$api` / `$gated`
+ `gate()` / `<Feature>`.

Evidence: branch
[`try/hey-api`](https://github.com/NoZiL/openapi-versions/tree/try/hey-api/spike/hey-api)
(`spike/hey-api/`, not for merging), with the generated output
committed.
- Open enums: `$resolvers` on `@hey-api/typescript`. Every `enum-shapes`
fixture matches openapi-typescript, and no helpers patch is needed.
- Core/gated split and the op-ID → op-key map are read from Hey API's IR
and symbol registry (Hey API's own naming, e.g. `delete` → `delete_`).
- `gate()` reads `queryKey[0]._id`. X-Api-Version and Sunset come
through a response interceptor.
- Copies of `test/types.check.ts` type-check on TS 5.4, 5.5, 6.0 and
7.0.2, and copies of the `test/react.test.tsx` scenarios pass (6 tests).

Risks in the ADR: 0.x with no stable release since 2026-06-22; TS 7
breaks generation on 0.99.0 (hey-api/hey-api#4235, fixed in `@next`);
two undocumented internals; output must go in `v<n>/sdk/` because of a
`client` name collision.

Closes #124

## Checklist

- [x] `mise run check` passes (what CI runs). Docs-only: ran `pnpm
lint`; CI runs the rest
- [ ] `pnpm changeset` added for any change to the published package.
Not needed: ADR only, same as #73 for ADR 0017
- [x] Generated output was not edited by hand (`playground/generated`,
`test/fixtures/generated`)
- [x] ADR added or superseded in `docs/adr/` if this touches a trigger
in `AGENTS.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant