@tetsujs/openapi 0.5.3 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,420 +1,24 @@
1
1
  # @tetsujs/openapi
2
2
 
3
- An OpenAPI 3.1 document and a docs page, generated from the routes you
4
- already declared.
3
+ An OpenAPI 3.1 document and docs page generated from [Tetsu](https://tetsujs.com) routes.
5
4
 
6
5
  ```bash
7
6
  bun add @tetsujs/openapi
8
7
  ```
9
8
 
10
- ## Usage
11
-
12
- Mount the `docs()` controller next to your own:
13
-
14
9
  ```ts
15
10
  import { docs } from "@tetsujs/openapi";
16
11
 
17
12
  createApp({
18
13
  routes: [
19
- group("/api", { children: [usersController({ users })] }),
14
+ group("/api", { children: [usersController()] }),
20
15
  docs({ info: { title: "Users API", version: "1.0.0" } }),
21
16
  ],
22
17
  });
23
18
  ```
24
19
 
25
- `/openapi.json` serves the document and `/docs` renders it. The document
26
- is built once, at startup, so anything that cannot be described is
27
- reported before the first request.
28
-
29
- `docs()` is an ordinary controller: put it in a group to move it under a
30
- prefix, guard it with hooks, or leave it out in production. Its own two
31
- routes are left out of the document.
32
-
33
- ### The page runs someone else's code on your origin
34
-
35
- The page loads its renderer — Scalar, Swagger UI or Redoc — from
36
- jsDelivr and runs it on the application's origin, with that origin's
37
- cookies. If a session cookie lives there, a renderer that is not what it
38
- should be acts as the signed-in user. The defaults are pinned to an exact
39
- version with a Subresource Integrity hash, so a file the CDN changes is
40
- refused by the browser; that does not make the renderer yours, and what it
41
- loads in turn is not covered.
42
-
43
- Where the origin carries a session, serve the document alone:
44
-
45
- ```ts
46
- docs({ info, ui: false });
47
- ```
48
-
49
- `/openapi.json` is served and there is no page. For a page anyway, host
50
- the renderer yourself or pin your own copy, with its hash:
51
-
52
- ```ts
53
- docs({
54
- info,
55
- assets: {
56
- script: "https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.72.1/dist/browser/standalone.js",
57
- integrity: { script: "sha384-…" },
58
- },
59
- });
60
- ```
61
-
62
- `curl -s <url> | openssl dgst -sha384 -binary | openssl base64 -A` prints
63
- the hash, to be prefixed with `sha384-`.
64
-
65
- ## Options
66
-
67
- | Option | Default | |
68
- | --- | --- | --- |
69
- | `info` | — | the document's `info`: title, version, description |
70
- | `servers` | — | where the API is reachable |
71
- | `path` | `/openapi.json` | where the document is served |
72
- | `uiPath` | `/docs` | where the page is served |
73
- | `ui` | `"scalar"` | `"scalar"`, `"swagger-ui"`, `"redoc"`, or `false` for no page |
74
- | `title` | the document's title | the page's title |
75
- | `assets` | the renderer on jsDelivr, pinned | your own renderer URLs, with `integrity` hashes |
76
- | `documentSelf` | `false` | include `/openapi.json` and `/docs` in the document |
77
- | `onWarning` | `console.warn` | receives what could not be described |
78
- | `errors` | the framework's envelope | an error format of your own — see [below](#an-error-format-of-your-own) |
79
- | `tags` | — | what each tag is, in the order the sidebar lists them — see [below](#tags) |
80
-
81
- ## How a route becomes an operation
82
-
83
- Every part of an operation comes from somewhere the application already
84
- wrote, by a rule:
85
-
86
- | In the document | Comes from | Rule |
87
- | --- | --- | --- |
88
- | the path | the route's `path`, under its groups' prefixes | `/users/:id` → `/users/{id}` |
89
- | `operationId` | `docs.operationId`, or the controller's name and the field | `setAvatar` in `controller("Users", …)` → `usersSetAvatar` — see [Operation ids](#operation-ids) |
90
- | `summary`, `description`, `tags`, `deprecated` | the route's `docs` | as written |
91
- | parameters | `schema.params`, `query`, `headers`, `cookies` | required as the schema says |
92
- | the request body | `schema.body` and `bodyType` | media types from `bodyType`; required unless `text` or `stream` |
93
- | `security` | `secured()` hooks, of every level the route runs under | every hook required together; `anyOf` inside one hook is the alternatives |
94
- | the statuses | the route's `schema.response`, the hooks' `documented()` and `secured()`, the framework | one schema is `200`, a map its statuses, `null` a status without a body; with no `2xx` declared, `200`; the framework's `422`, `400`, `413`, `500` where they can happen — see [Responses the framework adds](#responses-the-framework-adds) |
95
- | a status's body | everything answering with that status | one flat `anyOf`, the route's own first, the same body once |
96
- | an error envelope | any of them | one definition per status and code in `components`, named after the code; the route's own kept |
97
- | `discriminator` | the envelopes of a status | on `error`, or the format's field, when every alternative is an envelope |
98
- | a status's description | the schemas' `description`, the hooks', the framework's | one is the description, several a list led by code, none the reason phrase |
99
- | a status's headers | the hooks' `documented()` headers | possible, not required |
100
- | the document's `tags` | the `tags` option | in its order, then the tags routes use and it leaves out |
101
-
102
- `docs: { hidden: true }` leaves a route out of the document; it is served
103
- as before. A route with no `schema.response` is documented as `200` — its
104
- handler may still answer `204` by returning nothing, which only a declared
105
- `204: null` says.
106
-
107
- ## Tags
108
-
109
- A route names its tags in `docs: { tags }`; the document says what each
110
- one is:
111
-
112
- ```ts
113
- docs({
114
- info,
115
- tags: {
116
- "sign-in": "Signing in with a code sent by email, and signing out",
117
- me: "The signed-in user",
118
- },
119
- });
120
- ```
121
-
122
- The order of the keys is the order of the sections a renderer lists. A tag
123
- the routes use and `tags` leaves out is listed after them, in the order
124
- the routes first use it, and reported — it is usually one tag spelled two
125
- ways, `sign_in` next to `sign-in`. So is a tag described and used by no
126
- operation. Without `tags` the document lists none, and nothing is
127
- reported. An application of several surfaces, each with its own `docs()`,
128
- gives each one only the tags of its own routes: given all of them, every
129
- `docs()` reports the tags of the others as unused.
130
-
131
- ## Operation ids
132
-
133
- A generated client names its methods after the `operationId`s, so they are
134
- a contract, and every one comes from a name you wrote:
135
-
136
- | Route | `operationId` |
137
- | --- | --- |
138
- | with `docs: { operationId }` | as written |
139
- | in `controller("Users", …)` as `setAvatar` | `usersSetAvatar` |
140
- | in a class `UsersController` as `setAvatar` | `usersSetAvatar` |
141
- | in an object literal as `setAvatar` | `setAvatar` |
142
- | mounted on its own, `POST /auth/code` | `postAuthCode` |
143
-
144
- Two routes arriving at the same id stop the application at startup, naming
145
- both — nothing is renamed behind your back, which would change a method in
146
- someone's SDK the day a route is added. Give one of them
147
- `docs.operationId`, or its controller a name of its own. On a public API,
148
- state the id on every route: it is then visible, and a change to it is a
149
- change a reviewer sees.
150
-
151
- ```ts
152
- route({
153
- method: "POST",
154
- path: "/internal/drain",
155
- docs: { summary: "Drain the queue", hidden: true },
156
- handler: () => queue.drain(),
157
- });
158
- ```
159
-
160
- Schemas are described through Standard Schema's JSON Schema support: Zod,
161
- Valibot, ArkType and [`@tetsujs/typebox`](../typebox) provide it.
162
-
163
- ## Responses the framework adds
164
-
165
- Failures the framework answers by itself are documented on every route
166
- where they can happen, in the same error envelope the server sends:
167
-
168
- | Status | `error` | When |
169
- | --- | --- | --- |
170
- | `422` (or the configured validation status) | `VALIDATION_FAILED` | a request part failed its schema |
171
- | `400` | `MALFORMED_JSON` / `MALFORMED_FORM` | the body could not be parsed |
172
- | `413` | `BODY_TOO_LARGE` | the body exceeded `maxBodySize` |
173
- | `500` | `INTERNAL_SERVER_ERROR` | any unhandled failure |
174
-
175
- The `error` code is a constant in each schema, so a generated client can
176
- tell failures apart by it. A status the route declares itself is kept, and
177
- the framework's failures for the same status are listed next to it.
178
-
179
- Every envelope — the framework's, a hook's, or one the route declares
180
- itself — is one definition in `components` per status and code, named
181
- after the code (`ITEM_NOT_FOUND` is `ItemNotFound`), so a generated client
182
- gets one type per failure. A schema is recognized as an envelope when its
183
- `error` is required and a single string. When the route and a hook both
184
- describe one code, the route's definition is kept; if the other one has
185
- different fields, the generator warns. A union the route declares joins
186
- the other failures of its status as one flat `anyOf`.
187
-
188
- When every alternative of a status is an envelope, the union carries a
189
- `discriminator` on `error`, with the mapping from each code to its
190
- definition, and a generated client narrows on the code.
191
-
192
- A status is described by what answers with it. The route's part is the
193
- `description` of the schema it declares — `.describe()` in Zod and
194
- ArkType, `v.description()` in Valibot, `{ description }` in TypeBox — for
195
- any status, a `200` as much as a `404`; a union described as a whole is
196
- one description, one described branch by branch is one per branch. A
197
- hook's part is its `documented()` description, the framework's its own.
198
- One description is the status's description; several are a list, each
199
- led by its code:
200
-
201
- ```md
202
- - `ACCOUNT_DISABLED`: this account is disabled
203
- - `CAPTCHA_FAILED`: the captcha token is missing or did not pass
204
- ```
205
-
206
- A status nothing describes keeps its reason phrase — `Not Found`,
207
- `Successful response`.
208
-
209
- ## An error format of your own
210
-
211
- Every failure reaches the application's `onError` hooks — a thrown
212
- `HttpError`, a validation or body failure, a `404`, a `405`, a rate limit's
213
- refusal — so one hook answers all of them in your format:
214
-
215
- ```ts
216
- const inOurFormat = hook.onError(({ error }) => {
217
- if (!(error instanceof HttpError)) return undefined;
218
-
219
- const { status, error: code, ...rest } = error.body as ErrorBody;
220
-
221
- return Response.json({ code, ...rest }, { status });
222
- });
223
- ```
224
-
225
- The document is generated from the routes, not from that hook, so it is
226
- told the same format with `errors`:
227
-
228
- ```ts
229
- const errors: ErrorFormat = {
230
- schema: ({ error, message, fields }) => ({
231
- type: "object",
232
- required: ["code", "message", ...Object.keys(fields)],
233
- properties: {
234
- code: error ? { type: "string", const: error } : { type: "string" },
235
- message: { type: "string", ...(message ? { examples: [message] } : {}) },
236
- ...fields,
237
- },
238
- }),
239
- discriminator: "code",
240
- };
241
-
242
- createApp({
243
- hooks: { onError: [inOurFormat] },
244
- routes: [api, docs({ info, errors })],
245
- });
246
- ```
247
-
248
- `schema` describes one failure from what the generator knows of it: its
249
- status, its code when known, an example message, and in `fields` what it
250
- carries besides — `issues` for a validation failure, `retryAfter` for a
251
- rate limit, a hook's own `fields`. It is used for the framework's failures
252
- and the hooks' refusals alike.
253
-
254
- `discriminator` names the top-level field that holds the code. Statuses of
255
- envelopes are then discriminated on it, and a route's own envelope is
256
- recognized by it — a `{ code: "ITEM_NOT_FOUND", … }` the route declares is
257
- the same definition as a hook's. A format that nests its code has no
258
- top-level field to name; it gives `code` instead, reading the code from a
259
- route's schema:
260
-
261
- ```ts
262
- code: (schema) => {
263
- const error = schema.properties?.error;
264
- const code = typeof error === "object" ? error.properties?.code : undefined;
265
-
266
- return typeof code === "object" && typeof code.const === "string" ? code.const : undefined;
267
- },
268
- ```
269
-
270
- The hook and `errors` describe one format in two places — the core knows
271
- nothing about documents, and a function cannot be read for the shape it
272
- returns — so keep a test that holds them together: provoke a failure and
273
- check its body against the document, with the JSON Schema validator of
274
- your choice.
275
-
276
- ```ts
277
- test("a validation failure is what the document says", async () => {
278
- const res = await request("/items", { method: "POST", body: "{}" });
279
- const schema = document.components?.schemas?.ValidationFailed;
280
-
281
- expect(validator.validate(schema, await res.json())).toBe(true);
282
- });
283
- ```
284
-
285
- ## Documenting hooks
286
-
287
- A hook that answers by itself — an auth check, a limiter — can say so, and
288
- every route it guards is documented accordingly. `secured()` adds a
289
- security scheme, `documented()` adds responses:
290
-
291
- ```ts
292
- import { documented, secured } from "@tetsujs/openapi";
293
-
294
- export const auth = secured(
295
- hook.beforeParse((ctx) => {
296
- const user = verify(ctx.req.headers.get("authorization"));
297
-
298
- if (!user) throw new HttpError(401);
299
-
300
- return { user };
301
- }),
302
- { name: "bearerAuth", scheme: { type: "http", scheme: "bearer", bearerFormat: "JWT" } },
303
- );
304
-
305
- export const guard = documented(hook.beforeParse(check), {
306
- responses: [
307
- {
308
- status: 429,
309
- description: "Rate limit exceeded",
310
- error: "RATE_LIMITED",
311
- fields: { retryAfter: { type: "integer", minimum: 0 } },
312
- headers: { "retry-after": { schema: { type: "integer", minimum: 0 } } },
313
- },
314
- ],
315
- });
316
- ```
317
-
318
- A response with an `error` code is the framework's envelope, defined once
319
- in `components` and named after the code. `fields` adds what the hook puts
320
- next to `status`, `message` and `error`, each always present; `headers`,
321
- what it sets on the response. Both are JSON Schema written by hand, typed
322
- keyword by keyword (`JsonSchema`), so a misspelled keyword does not
323
- compile. A hook whose body is not the envelope passes a `schema` instead.
324
-
325
- Hooks from `@tetsujs/rate-limit` are already documented this way. A scheme
326
- is identified by its `name`: the same one mounted twice is one
327
- requirement, and two different schemes under one name are reported.
328
-
329
- Every hook of a route runs, so every scheme its hooks carry is required
330
- together: a route behind a CSRF check and a captcha is documented as
331
- needing both, one entry of `security` — in OpenAPI, separate entries mean
332
- any one of them will do. Two hooks of one scheme require the scopes of
333
- both.
334
-
335
- "Either" lives inside one hook: a hook that accepts a session cookie or a
336
- bearer token says so with `anyOf`, and the document lists every
337
- combination a client may bring:
338
-
339
- ```ts
340
- export const caller = secured(hook.beforeParse(sessionOrToken), {
341
- anyOf: [cookieSession, bearerToken],
342
- });
343
-
344
- // with a CSRF check on the same route:
345
- // security: [{ session: [], csrf: [] }, { bearer: [], csrf: [] }]
346
- ```
347
-
348
- ## Using the document directly
20
+ Options, details and recipes: **[tetsujs.com/docs/packages/openapi](https://tetsujs.com/docs/packages/openapi/)**
349
21
 
350
- When the document itself is the output — written to a file in CI, fed to a
351
- client generator — call the generator:
352
-
353
- ```ts
354
- import { openapi } from "@tetsujs/openapi";
355
-
356
- const { document, warnings } = openapi(app, {
357
- info: { title: "Users API", version: "1.0.0" },
358
- });
359
-
360
- await Bun.write("openapi.json", JSON.stringify(document, null, 2));
361
- ```
362
-
363
- `docsPage()` renders the page on its own, for serving it elsewhere.
364
-
365
- ## Testing against the document
366
-
367
- `@tetsujs/openapi/testing` checks a response a test provoked against the
368
- operation the document describes:
369
-
370
- ```ts
371
- import { assertDescribed } from "@tetsujs/openapi/testing";
372
-
373
- const { document } = openapi(app, { info });
374
-
375
- test("a wrong code is what the document says", async () => {
376
- const res = await request("/session", { method: "POST", body });
377
-
378
- await assertDescribed(document, "POST /session", res);
379
- });
380
- ```
381
-
382
- It throws unless the status is declared and the body fits one of the
383
- alternatives its status describes, listing every problem at once:
384
-
385
- ```
386
- POST /session answered 403, which the document does not describe:
387
- - error "CAPTCHA_FAILED", which its 403 does not list: ACCOUNT_DISABLED, CSRF_HEADER_REQUIRED
388
- ```
389
-
390
- The operation is named as the test called it, a method and the path it
391
- requested, matched against the document's templates. Without a validator
392
- only the top level of the body is compared — required fields, and fields
393
- that are a `const`, which is where an envelope keeps its code. `validate`
394
- checks the whole body with the JSON Schema validator of your choice, given
395
- a schema that stands on its own; `headers` names headers the status must
396
- declare when the response carries them:
397
-
398
- ```ts
399
- await assertDescribed(document, "POST /session", res, {
400
- validate: (schema, body) => ajv.validate(schema, body) || ajv.errorsText(),
401
- headers: ["retry-after"],
402
- });
403
- ```
404
-
405
- The core does not check a thrown error against the route's response map:
406
- a guard's refusal would be reported on every route it runs on. A test asks
407
- about the one response it provoked.
408
-
409
- ## Warnings
410
-
411
- A route is still documented when part of it cannot be described, and the
412
- gap is reported instead of failing the startup:
413
-
414
- ```
415
- [openapi] POST /api/users: the body schema does not emit JSON Schema
416
- ```
22
+ ## License
417
23
 
418
- This happens with a validator that does not emit JSON Schema, a schema
419
- whose conversion throws, and two routes that map to the same OpenAPI path
420
- (`/files/*` and `/files/:wildcard` are both `/files/{wildcard}`).
24
+ [MIT](https://github.com/tetsujs/tetsu/blob/main/LICENSE)
@@ -42,6 +42,7 @@ export type ContentMap = Record<string, {
42
42
  /** A header a response carries. */
43
43
  export interface HeaderObject {
44
44
  readonly description?: string;
45
+ readonly required?: boolean;
45
46
  readonly schema: JsonSchema;
46
47
  }
47
48
  /** One response of an operation. */
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/document.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,kDAAkD;AAClD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,wCAAwC;AACxC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,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