Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

emit-openapi.ts

11 lines480 Bytes

1// Writes the service's OpenAPI document (src/server/openapi.ts) to
2// ./openapi.json — the input for client generation (task 7.4) and the
3// drift check. Run via `pnpm run openapi:emit`.
4import { writeFileSync } from 'node:fs'
5import { join } from 'node:path'
6​
7import { openApiDocument } from '../src/server/openapi.ts'
8​
9const out = join(import.meta.dirname, '..', 'openapi.json')
10writeFileSync(out, JSON.stringify(openApiDocument, null, 2) + '\n')
11console.log(`wrote ${out}`)