@softistx/alxia-openapi 0.0.0-stage → 0.7.0

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.
@@ -0,0 +1,494 @@
1
+ # Troubleshooting
2
+
3
+ Each entry is headed by the text you see: a `TypeError` one of the checks
4
+ threw, a line `nxgt-openapi generate` printed, or an error from `tsc`. The counts, methods and paths in a message
5
+ are the app's own, written `…` below. A check that passes when you expected
6
+ it to fail prints nothing; those are under [Traps](#traps), by symptom.
7
+
8
+ **Thrown**
9
+
10
+ - [`TypeError: implemented(): … operations have no route: …`](#typeerror-implemented--operations-have-no-route-)
11
+ - [`TypeError: matchesSpec(): … routes have no operation: …`](#typeerror-matchesspec--routes-have-no-operation-)
12
+ - [`TypeError: implemented(): the prefix "…" must start with "/" and not end with one`](#typeerror-implemented-the-prefix--must-start-with--and-not-end-with-one)
13
+ - [`TypeError: implemented(): "…": ":…" is not a parameter name`](#typeerror-implemented---is-not-a-parameter-name)
14
+
15
+ **API docs**
16
+
17
+ - [`TypeError: apiDocs(): cannot read the spec "…"`](#typeerror-apidocs-cannot-read-the-spec-)
18
+ - [`TypeError: apiDocs(): the path "…" must start with "/" and not end with one`](#typeerror-apidocs-the-path--must-start-with--and-not-end-with-one)
19
+ - [The page is blank, and the console reports a blocked script](#the-page-is-blank-and-the-console-reports-a-blocked-script)
20
+ - [`matchesSpec(): … routes have no operation: GET /docs, …`](#matchesspec--routes-have-no-operation-get-docs-)
21
+
22
+ **Generator** (`@nxgt/openapi-codegen` 0.11.0)
23
+
24
+ - [`alxia.ts leaves it out. … [ignored]`](#alxiats-leaves-it-out--ignored)
25
+ - [A cookie parameter is missing from `types.ts` and the client files](#a-cookie-parameter-is-missing-from-typests-and-the-client-files)
26
+ - [A client refuses alxia's 400, or types it `{ status, message, timestamp, issues }`](#a-client-refuses-alxias-400-or-types-it--status-message-timestamp-issues-)
27
+ - [A test through the client sends a request to a real address](#a-test-through-the-client-sends-a-request-to-a-real-address)
28
+ - [`ValidationError: createTodo (POST /todos): …`, thrown by a test of the app's 400 or 401](#validationerror-createtodo-post-todos--thrown-by-a-test-of-the-apps-400-or-401)
29
+ - [`UndeclaredStatusError: getTodo (GET /todos/{id}): no 418 reply is declared`](#undeclaredstatuserror-gettodo-get-todosid-no-418-reply-is-declared)
30
+
31
+ **Types**
32
+
33
+ - [`Type '"TRACE"' is not assignable to type 'Method'`](#type-trace-is-not-assignable-to-type-method)
34
+ - [``Type '"pets"' is not assignable to type '`/${string}`'``](#type-pets-is-not-assignable-to-type-string)
35
+ - [`Argument of type '{ method: string; path: string; }[]' is not assignable to parameter of type 'Operations'`](#argument-of-type--method-string-path-string--is-not-assignable-to-parameter-of-type-operations)
36
+ - [`Property 'routes' is missing in type '…' but required in type '{ readonly routes: readonly RouteDefinition[]; }'`](#property-routes-is-missing-in-type--but-required-in-type--readonly-routes-readonly-routedefinition-)
37
+ - [`Module '"@softistx/alxia-openapi"' has no exported member 'docs'`](#module-softistxalxia-openapi-has-no-exported-member-docs)
38
+
39
+ **Traps**
40
+
41
+ - [Every operation is listed, though the app serves them](#every-operation-is-listed-though-the-app-serves-them)
42
+ - [An operation of the spec is never listed](#an-operation-of-the-spec-is-never-listed)
43
+
44
+ ## Thrown
45
+
46
+ ### `TypeError: implemented(): … operations have no route: …`
47
+
48
+ Also as `1 operation has no route: …`, and as the first half of a
49
+ `matchesSpec()` message.
50
+
51
+ ```text
52
+ TypeError: implemented(): 2 operations have no route: GET /pets/:petId (getPet), QUERY /employees (searchEmployees)
53
+ ```
54
+
55
+ **When:** an operation of `operations` has no route of its method and path
56
+ on the app. Each is named by method, the full path looked up, and its
57
+ operation id, its key in the object, or `schema.detail.operationId` in a
58
+ list.
59
+
60
+ **Why:** nobody declared it yet, it is declared under another method, or it
61
+ is declared after the check ran.
62
+
63
+ **Fix:** declare each one from its operation:
64
+
65
+ ```ts
66
+ // pets, search: your own store and query
67
+ const app = alxia()
68
+ .route(api.getPet, ({ params, reply }) => {
69
+ const pet = pets.get(params.petId);
70
+ return pet ? reply.ok(pet) : reply.notFound({ title: 'No such pet' });
71
+ })
72
+ .route(api.searchEmployees, ({ body, reply }) => reply.ok(search(body)));
73
+
74
+ implemented(app, api);
75
+ ```
76
+
77
+ Call the check after the last `route`, `use`, `plugin` and `group`. If every
78
+ operation is listed, see
79
+ [Every operation is listed](#every-operation-is-listed-though-the-app-serves-them).
80
+
81
+ ### `TypeError: matchesSpec(): … routes have no operation: …`
82
+
83
+ Also as `1 route has no operation: …`, after a `;` when operations are
84
+ missing too:
85
+
86
+ ```text
87
+ TypeError: matchesSpec(): 1 operation has no route: GET /pets/:petId (getPet); 1 route has no operation: POST /admin/reset
88
+ ```
89
+
90
+ **When:** `matchesSpec` ran with `strict: true` and found a route on the app
91
+ that no operation declares, named by method and full path. Without
92
+ `strict`, such a route does not fail the check: it is listed in the report's
93
+ `extra`.
94
+
95
+ **Why:** the route is not in the spec — an admin route, a health check, the
96
+ pages of a React Router app, an `app.static('/assets', …)` mount
97
+ (`GET /assets/*`) — or the spec's operation was renamed or removed and the
98
+ route was not. The probes of `@softistx/alxia`'s `health()` and the routes
99
+ of `apiDocs()` are never listed: `matchesSpec` leaves them out by itself,
100
+ so a `/health` here is a route written by hand.
101
+
102
+ **Fix:** add the operation to the document and generate again, remove the
103
+ route, leave it out on purpose with `exclude`, or drop `strict` to let the
104
+ app serve routes the document does not describe:
105
+
106
+ ```ts
107
+ matchesSpec(app, api, {
108
+ strict: true,
109
+ exclude: (route) => route.path === '/health' || route.path.startsWith('/assets/'),
110
+ });
111
+ ```
112
+
113
+ If only the routes that need no operation are listed, the default
114
+ `matchesSpec` or `implemented` may be the check you want.
115
+
116
+ ### `TypeError: implemented(): the prefix "…" must start with "/" and not end with one`
117
+
118
+ Also as `matchesSpec(): the prefix "…" …`.
119
+
120
+ ```text
121
+ TypeError: implemented(): the prefix "/api/" must start with "/" and not end with one
122
+ ```
123
+
124
+ **When:** `prefix` ends with `/`, or is `/` alone; leave it out for an app
125
+ with no prefix. One without a leading `/` does not
126
+ [compile](#type-pets-is-not-assignable-to-type-string).
127
+
128
+ **Why:** the prefix is the app's, which the core refuses written that way
129
+ (`The prefix "…" must start with "/" and not end with one`); looked up as
130
+ given, it would name `/api//pets/:petId`, and every operation would be
131
+ reported missing.
132
+
133
+ **Fix:** write it as the app's: `{ prefix: '/api' }`.
134
+
135
+ ### `TypeError: implemented(): "…": ":…" is not a parameter name`
136
+
137
+ Also as `matchesSpec(): …`, and with any other
138
+ message the core throws for a route path:
139
+ `The route path "…" must start with "/"`, `"…": "*" may only end a path`,
140
+ `"…" declares ":…" twice`, `"…": ":" may only start a segment, as a
141
+ parameter`, `"…": "*" may only be a whole segment, as a wildcard`,
142
+ `"…": "…" is a dot segment, which a request's URL never keeps`,
143
+ `"…" is not encoded as a request's URL carries it: declare "…"`.
144
+
145
+ ```text
146
+ TypeError: implemented(): "/pets/:pet-id": ":pet-id" is not a parameter name
147
+ ```
148
+
149
+ **When:** an operation's path is one no route may be declared at: a
150
+ parameter that is not an identifier, a `*` before the last segment, a name
151
+ given twice, a `:` or a `*` inside a segment (`/at/10:45`), a dot segment,
152
+ a literal not percent-encoded as a URL carries it (`/café`).
153
+
154
+ **Why:** an operation is matched by its shape, which the core's `shapeOf`
155
+ reads as the router does, and it refuses such a path as `app.route` would.
156
+ No route could serve it, so the check throws, naming the path and the
157
+ core's reason, rather than list it.
158
+
159
+ **Fix:** rename the parameter in the operation, as the route that serves it
160
+ must: `/pets/:petId`. A generator writing `operations` from a document turns
161
+ `{pet-id}` into a name the core accepts. For the other messages, write
162
+ the path as the core's entry for it says: a `:time` parameter for
163
+ `/at/10:45`
164
+ ([`":" may only start a segment`](https://github.com/softistx/alxia/blob/develop/packages/core/docs/troubleshooting.md#--may-only-start-a-segment-as-a-parameter)),
165
+ `/caf%C3%A9` for `/café`
166
+ ([`is not encoded as a request's URL carries it`](https://github.com/softistx/alxia/blob/develop/packages/core/docs/troubleshooting.md#-is-not-encoded-as-a-requests-url-carries-it-declare-)).
167
+
168
+ ## API docs
169
+
170
+ ### `TypeError: apiDocs(): cannot read the spec "…"`
171
+
172
+ ```text
173
+ TypeError: apiDocs(): cannot read the spec "openapi.yaml" (ENOENT), looked up from the working directory /srv/app
174
+ ```
175
+
176
+ **When:** the app starts, or `apiDocs` is called, and `spec` is a path that
177
+ is not a readable file.
178
+
179
+ **Why:** a relative path is looked up from the working directory of the
180
+ process, not from the file that calls `apiDocs`: `bun run src/server.ts`
181
+ from another folder, or a container whose image holds `dist/` alone, does
182
+ not see `openapi.yaml`.
183
+
184
+ **Fix:** import the document and give the object: `bun build` bundles it,
185
+ so it is there wherever the app runs. Or give a path that holds there:
186
+
187
+ ```ts
188
+ import spec from '../openapi.yaml'; // bundled with the app
189
+ apiDocs({ spec });
190
+ // or, from this file's folder:
191
+ apiDocs({ spec: new URL('../openapi.yaml', import.meta.url).pathname });
192
+ ```
193
+
194
+ The same error says `is not an OpenAPI document` for a file with no
195
+ `openapi` version, and `neither valid YAML nor valid JSON` for one that does
196
+ not parse. With `enabled: false` nothing is read.
197
+
198
+ ### `TypeError: apiDocs(): the path "…" must start with "/" and not end with one`
199
+
200
+ Also `apiDocs(): ui "…" is not "scalar" or "swagger"`.
201
+
202
+ **When:** `path` is `docs` or `/docs/`, or `ui` is another name.
203
+
204
+ **Fix:** `apiDocs({ spec, path: '/docs', ui: 'scalar' })`.
205
+
206
+ ### The page is blank, and the console reports a blocked script
207
+
208
+ ```text
209
+ Refused to load the script 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@…' because it violates the following Content Security Policy directive: "script-src 'self'"
210
+ ```
211
+
212
+ **Symptom:** `/docs` answers 200 and the page stays empty.
213
+
214
+ **Why:** the response carries a policy that is not the page's. The page
215
+ sets its own `Content-Security-Policy`, which `secureHeaders` keeps, so
216
+ this is a policy set by a proxy or a CDN in front of the app, or by a
217
+ middleware that replaces the header after the page set it.
218
+
219
+ **Fix:** let the policy of the page through: `curl -I /docs` should show
220
+ `script-src https://cdn.jsdelivr.net 'nonce-…'`. If it must be your own,
221
+ allow `https://cdn.jsdelivr.net` for `script-src` and `style-src`,
222
+ `'unsafe-inline'` for `style-src`, and `'self'` for `connect-src`.
223
+
224
+ ### `matchesSpec(): … routes have no operation: GET /docs, …`
225
+
226
+ **When:** the message lists the docs routes, under `strict`.
227
+
228
+ **Why:** under `strict`, `matchesSpec` leaves out the routes `apiDocs` declared, by their
229
+ handlers. A route declared by hand at `/docs`, or by a copy of
230
+ `@softistx/alxia-openapi` the check does not share (two versions installed), is not
231
+ recognised.
232
+
233
+ **Fix:** one version of `@softistx/alxia-openapi` (`bun why @softistx/alxia-openapi`), or
234
+ `matchesSpec(app, operations, { strict: true, exclude: (r) => r.path.startsWith('/docs') })`.
235
+
236
+ ## Generator
237
+
238
+ These come from `bunx nxgt-openapi generate`, with `alxia: true`, before
239
+ any check runs. Its guide lists every
240
+ [diagnostic](https://github.com/softistx/nxgt-http/blob/develop/packages/openapi-codegen/docs/guide/diagnostics.md).
241
+
242
+ ### `alxia.ts leaves it out. … [ignored]`
243
+
244
+ ```text
245
+ warning openapi.yaml#/paths/~1feed/get: watchFeed: alxia.ts leaves it out. Its 200 reply streams the event `ping` with text data [ignored]
246
+ ```
247
+
248
+ **When:** a reply is `text/event-stream` whose event has text data, or
249
+ whose `itemSchema` names no events, so each event's data is not JSON.
250
+
251
+ **Why:** the generated `eventStream({ name: schema })` sends each event's
252
+ data as JSON, so the generator leaves the operation out of `alxia.ts`
253
+ rather than type it wrongly. It is not in `operations`, so `implemented` does not list
254
+ it either. Named events whose data is JSON are generated.
255
+
256
+ **Fix:** give each event's data `contentMediaType: application/json` and a
257
+ `contentSchema` in the spec, as below, or declare the route by hand, with
258
+ `eventStream` from `@softistx/alxia`, which takes a schema per event name
259
+ ([server-sent events](https://github.com/softistx/alxia/blob/develop/packages/core/docs/guide/server-sent-events.md)).
260
+
261
+ ```yaml
262
+ text/event-stream:
263
+ itemSchema:
264
+ type: object
265
+ properties:
266
+ event: { const: tick }
267
+ data:
268
+ contentMediaType: application/json
269
+ contentSchema: { $ref: '#/components/schemas/Tick' }
270
+ ```
271
+
272
+ Other `ignored` warnings — a `TRACE`, a binary body, a binary, JSON Lines
273
+ or form reply — mean the same: declare the route by hand if you serve it.
274
+
275
+ ### A cookie parameter is missing from `types.ts` and the client files
276
+
277
+ ```text
278
+ warning openapi.yaml#/paths/~1me/get: getMe: types.ts, zod.ts, operations.ts and paths.ts leave out its cookie `session`: a client does not set cookies, the browser or its cookie jar sends them [ignored]
279
+ ```
280
+
281
+ **Symptom:** an operation declares a parameter `in: cookie`, and the
282
+ generator warns `ignored`; the parameter is not in `types.ts`, `zod.ts`,
283
+ `operations.ts` or `paths.ts`.
284
+
285
+ **Why:** a client does not set cookies, so only `alxia.ts` validates the
286
+ parameter, as `cookies`. Before 0.7 the generator refused the whole
287
+ document instead.
288
+
289
+ **Fix:** none: the route's handler reads the validated `cookies`.
290
+
291
+ ```ts
292
+ app.route(operations.getMe, ({ cookies, reply }) => reply.ok(findUser(cookies.session)));
293
+ ```
294
+
295
+ ### A client refuses alxia's 400, or types it `{ status, message, timestamp, issues }`
296
+
297
+ **Symptom:** a client generated from the document fails to decode a 400,
298
+ or its type says the body is `ValidationErrorBody`, with `status`,
299
+ `message` and `timestamp`.
300
+
301
+ **Why:** `validationErrors` defaults to `true`, which declares
302
+ `@nxgt/openapi-hono`'s 400 in `types.ts`, `zod.ts`, `operations.ts` and
303
+ `paths.ts`. alxia answers `{ error: 'validation', issues }` instead.
304
+
305
+ **Fix:** set `validationErrors: false`, declare alxia's 400 in the spec
306
+ ([Spec first](guide/spec-first.md#declare-alxias-own-400)), and generate
307
+ again:
308
+
309
+ ```ts
310
+ export default defineConfig({
311
+ input: 'openapi.yaml',
312
+ output: 'src/generated',
313
+ alxia: true,
314
+ validationErrors: false,
315
+ });
316
+ ```
317
+
318
+ ### A test through the client sends a request to a real address
319
+
320
+ **Symptom:** a test using `createHttpClient({ baseUrl })` fails with
321
+ `ConnectionRefused` or `Unable to connect`, or reaches a server that is
322
+ running.
323
+
324
+ **Why:** no `fetch` was given, so the client uses the global one and sends
325
+ the request over the network. The app is called in process only when the
326
+ client's `fetch` is `app.fetch`.
327
+
328
+ **Fix:** pass it, and `baseUrl` stays a name nothing answers to:
329
+
330
+ ```ts
331
+ const http = createHttpClient({
332
+ baseUrl: 'http://alxia.test',
333
+ fetch: (request) => app.fetch(request),
334
+ });
335
+ ```
336
+
337
+ See [Testing with the generated client](guide/testing.md).
338
+
339
+ ### `ValidationError: createTodo (POST /todos): …`, thrown by a test of the app's 400 or 401
340
+
341
+ **Symptom:** a test through the client throws before the app answers:
342
+ `ValidationError: createTodo (POST /todos): Too small: expected string to
343
+ have >=1 characters`.
344
+
345
+ **Why:** the client checks each request against the spec before it sends it,
346
+ so a request the server would refuse never leaves the test.
347
+
348
+ **Fix:** a second client with `validate: { request: false }` sends it:
349
+
350
+ ```ts
351
+ const raw = createOpenApiClient(http, operations, {
352
+ validate: { request: false },
353
+ });
354
+ expect((await raw.op('createTodo', { json: { title: '' } })).status).toBe(400);
355
+ ```
356
+
357
+ See [Testing with the generated client](guide/testing.md#keep-one-apprequest-test).
358
+
359
+ ### `UndeclaredStatusError: getTodo (GET /todos/{id}): no 418 reply is declared`
360
+
361
+ **Symptom:** a test through the client throws, naming a status.
362
+
363
+ **Why:** the app answered a status the operation's `responses` in the
364
+ document do not declare. `error.response` is the unread `Response`.
365
+
366
+ **Fix:** declare the status in the document and generate again, or fix the
367
+ route so it does not send it. The entry in `@softistx/alxia-create`'s
368
+ [troubleshooting](https://github.com/softistx/alxia/blob/develop/packages/create/docs/troubleshooting.md#undeclaredstatuserror-gettodo-get-todosid-no-418-reply-is-declared)
369
+ has the whole of it.
370
+
371
+ ## Types
372
+
373
+ ### `Type '"TRACE"' is not assignable to type 'Method'`
374
+
375
+ ```text
376
+ error TS2322: Type '"TRACE"' is not assignable to type 'Method'.
377
+ ```
378
+
379
+ **When:** an operation has a method alxia cannot route.
380
+
381
+ **Why:** each operation is a `RouteOperation`, whose `method` is one the
382
+ core serves: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD` or
383
+ `QUERY`. The generator leaves a `TRACE` out of `alxia.ts` for that reason.
384
+
385
+ **Fix:** remove the operation from the list; no app can serve it.
386
+
387
+ ### ``Type '"pets"' is not assignable to type '`/${string}`'``
388
+
389
+ ```text
390
+ error TS2322: Type '"pets"' is not assignable to type '`/${string}`'.
391
+ ```
392
+
393
+ Also as ``Type '"api"' is not assignable to type '`/${string}`'`` for a
394
+ `prefix`.
395
+
396
+ **When:** an operation's `path`, or `prefix`, does not start with `/`.
397
+
398
+ **Fix:** write it as the route would: `{ method: 'GET', path: '/pets' }`,
399
+ and the prefix as the app's: `{ prefix: '/api' }`.
400
+
401
+ ### `Argument of type '{ method: string; path: string; }[]' is not assignable to parameter of type 'Operations'`
402
+
403
+ ```text
404
+ error TS2345: Argument of type '{ method: string; path: string; }[]' is not assignable to parameter of type 'Operations'.
405
+ Type '{ method: string; path: string; }[]' is not assignable to type '{ readonly [name: string]: RouteOperation; }'.
406
+ Index signature for type 'string' is missing in type '{ method: string; path: string; }[]'.
407
+ ```
408
+
409
+ **When:** a list of operations written by hand, in a variable of its own,
410
+ without `as const`.
411
+
412
+ **Why:** TypeScript widens each `method` to `string` and each `path` to
413
+ `string`, and a `RouteOperation` needs a `Method` and a path starting with
414
+ `/`.
415
+
416
+ **Fix:** keep the literals:
417
+
418
+ ```ts
419
+ import type { RouteOperation } from '@softistx/alxia';
420
+
421
+ const ops = [{ method: 'GET', path: '/pets' }] as const;
422
+ // or: const ops: RouteOperation[] = [{ method: 'GET', path: '/pets' }];
423
+ implemented(app, ops);
424
+ ```
425
+
426
+ ### `Property 'routes' is missing in type '…' but required in type '{ readonly routes: readonly RouteDefinition[]; }'`
427
+
428
+ ```text
429
+ error TS2345: Argument of type '{ readonly getPet: …; }' is not assignable to parameter of type '{ readonly routes: readonly RouteDefinition[]; }'.
430
+ Property 'routes' is missing in type '{ readonly getPet: …; }' but required in type '{ readonly routes: readonly RouteDefinition[]; }'.
431
+ ```
432
+
433
+ **When:** the first argument is not an app: often the operations and the
434
+ app given in the wrong order, `implemented(operations, app)`.
435
+
436
+ **Fix:** the app first: `implemented(app, operations)`.
437
+
438
+ ### `Module '"@softistx/alxia-openapi"' has no exported member 'docs'`
439
+
440
+ ```text
441
+ error TS2305: Module '"@softistx/alxia-openapi"' has no exported member 'docs'.
442
+ ```
443
+
444
+ Also for `openapi`, `toJsonSchema`, `Converter`, `openApiPath` and the other
445
+ exports of `@alxia/openapi` 0.3 or earlier.
446
+
447
+ **When:** code written for `@alxia/openapi` 0.1 to 0.3, after installing
448
+ 0.4 or later.
449
+
450
+ **Why:** that package wrote a document from the app, and is retired: alxia
451
+ is spec first, and the name now belongs to the package that checks an app
452
+ against its document.
453
+
454
+ **Fix:** write the document, generate the operations from it, and check
455
+ the app with `matchesSpec`, as
456
+ [Coming from `@alxia/openapi` 0.3](https://github.com/softistx/alxia/blob/develop/packages/openapi/README.md#coming-from-alxiaopenapi-03-or-alxiaopenapi-routes)
457
+ says: the document the old package served, saved as a file, is a good
458
+ start for your own.
459
+
460
+ ## Traps
461
+
462
+ ### Every operation is listed, though the app serves them
463
+
464
+ **Symptom:** the message lists every operation, with paths that look right.
465
+
466
+ **Why:** the app has a prefix, `alxia({ prefix: '/api' })`, so it serves
467
+ `GET /api/pets/:petId`, and the operation's `/pets/:petId` is not there.
468
+
469
+ Or the operations were written by hand with OpenAPI's braces,
470
+ `/pets/{petId}`, which no route matches: the router's paths read
471
+ `/pets/:petId`.
472
+
473
+ **Fix:** give the prefix, written as the app's, a leading `/` and no
474
+ trailing one:
475
+
476
+ ```ts
477
+ implemented(app, api, { prefix: '/api' });
478
+ ```
479
+
480
+ The message then names the full paths, `GET /api/pets/:petId`. For a
481
+ hand-written operation, write its path `/pets/:petId`.
482
+
483
+ ### An operation of the spec is never listed
484
+
485
+ **Symptom:** a route the spec declares is missing, and the check passes.
486
+
487
+ **Why:** the operation is not in `operations`. `@nxgt/openapi-codegen`
488
+ leaves out what alxia cannot route or validate yet — a `TRACE`, a binary
489
+ body, JSON Lines, events with text data — with an `ignored` warning
490
+ ([one of them](#alxiats-leaves-it-out--ignored)). The check only knows the
491
+ operations it is given.
492
+
493
+ **Fix:** read the generator's warnings, and declare such a route by hand
494
+ with a route method.
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
- "name": "@softistx/alxia-openapi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@softistx/alxia-openapi",
3
+ "version": "0.7.0",
4
+ "description": "OpenAPI spec first for @softistx/alxia: the routes of an app bound to the operations generated from its document, and checked against them",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "docs",
12
+ "README.md",
13
+ "package.json",
14
+ "LICENSE"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/softistx/alxia.git",
27
+ "directory": "packages/openapi"
28
+ },
29
+ "publishConfig": {
30
+ "registry": "https://registry.npmjs.org",
31
+ "access": "public"
32
+ },
33
+ "scripts": {
34
+ "build": "bun run ../../build.ts",
35
+ "test": "bun test src",
36
+ "typecheck": "tsc --noEmit"
37
+ },
38
+ "alxia": {
39
+ "entrypoints": [
40
+ "src/index.ts"
41
+ ]
42
+ },
43
+ "devDependencies": {
44
+ "@softistx/alxia": "^0.28.0",
45
+ "@softistx/alxia-secure-headers": "^0.6.0",
46
+ "@types/bun": "^1.4.4",
47
+ "zod": "^4.2.0"
48
+ },
49
+ "peerDependencies": {
50
+ "@softistx/alxia": "^0.28.0",
51
+ "typescript": "^6.0.3 || ^7.0.0"
52
+ }
53
+ }