feat(server): Server.openapi() backed by HttpApi spec, parity-checked against Hono output (#25545)

This commit is contained in:
Kit Langton
2026-05-03 09:06:23 -04:00
committed by GitHub
parent 3c9f3c5786
commit 0ee3b87289
6 changed files with 48 additions and 15 deletions

View File

@@ -12,10 +12,12 @@ import { createClient } from "@hey-api/openapi-ts"
const openapiSource = process.env.OPENCODE_SDK_OPENAPI === "hono" ? "hono" : "httpapi"
const opencode = path.resolve(dir, "../../opencode")
// `bun dev generate` now derives the spec from the Effect HttpApi contract by
// default; pass `--hono` to fall back to the legacy Hono spec for parity diffs.
if (openapiSource === "httpapi") {
await $`bun dev generate --httpapi > ${dir}/openapi.json`.cwd(opencode)
} else {
await $`bun dev generate > ${dir}/openapi.json`.cwd(opencode)
} else {
await $`bun dev generate --hono > ${dir}/openapi.json`.cwd(opencode)
}
await createClient({