next-openapi-gen 1.2.3 → 1.4.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.
- package/README.md +36 -33
- package/dist/cli.js +319 -143
- package/dist/index.js +319 -143
- package/dist/next/index.js +204 -28
- package/dist/react-router/index.js +204 -28
- package/dist/vite/index.js +204 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -276,45 +276,48 @@ Version guidance:
|
|
|
276
276
|
|
|
277
277
|
### Important options
|
|
278
278
|
|
|
279
|
-
| Option | Purpose
|
|
280
|
-
| ------------------------------------- |
|
|
281
|
-
| `openapi` | Target `3.0.0`, `3.1.0`, or `3.2.0` output
|
|
282
|
-
| `apiDir` | Route directory to scan
|
|
283
|
-
| `routerType` | `"app"` or `"pages"`
|
|
284
|
-
| `schemaDir` | Directory or directories to search for schemas/types
|
|
285
|
-
| `schemaType` | `"zod"`, `"typescript"`, or both
|
|
286
|
-
| `schemaFiles` | YAML/JSON OpenAPI fragments to merge into the generated document
|
|
287
|
-
| `includeOpenApiRoutes` | Only include handlers tagged with `@openapi`
|
|
288
|
-
| `ignoreRoutes` | Exclude routes with wildcard support
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
279
|
+
| Option | Purpose |
|
|
280
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
281
|
+
| `openapi` | Target `3.0.0`, `3.1.0`, or `3.2.0` output |
|
|
282
|
+
| `apiDir` | Route directory to scan |
|
|
283
|
+
| `routerType` | `"app"` or `"pages"` |
|
|
284
|
+
| `schemaDir` | Directory or directories to search for schemas/types |
|
|
285
|
+
| `schemaType` | `"zod"`, `"typescript"`, or both |
|
|
286
|
+
| `schemaFiles` | YAML/JSON OpenAPI fragments to merge into the generated document |
|
|
287
|
+
| `includeOpenApiRoutes` | Only include handlers tagged with `@openapi` |
|
|
288
|
+
| `ignoreRoutes` | Exclude routes with wildcard support |
|
|
289
|
+
| `excludeSchemas` | Exclude internal schemas from `components/schemas` by name or glob (e.g. `["*Params"]`) |
|
|
290
|
+
| `defaultResponseSet` / `responseSets` | Reusable error-response groups |
|
|
291
|
+
| `errorConfig` | Shared error schema templates |
|
|
292
|
+
| `authPresets` | Override or extend the `@auth` keyword → scheme-name mapping |
|
|
291
293
|
|
|
292
294
|
For a fuller setup guide, Pages Router notes, response sets, and route exclusion
|
|
293
295
|
patterns, see [docs/getting-started.md](./docs/getting-started.md).
|
|
294
296
|
|
|
295
297
|
## JSDoc tags you will use most
|
|
296
298
|
|
|
297
|
-
| Tag | Purpose
|
|
298
|
-
| -------------------------- |
|
|
299
|
-
| `@pathParams` | Path parameter schema or type
|
|
300
|
-
| `@params` / `@queryParams` | Query parameter schema or type
|
|
301
|
-
| `@header` / `@cookie` | Header / cookie parameter schema or type
|
|
302
|
-
| `@body` | Request body schema or type
|
|
303
|
-
| `@response` | Response schema, code, and optional description
|
|
304
|
-
| `@responseDescription` | Response description without redefining the schema
|
|
305
|
-
| `@responseHeader` | Add a response header to a given status code
|
|
306
|
-
| `@link` | Add an OpenAPI link to a response
|
|
307
|
-
| `@auth` / `@security` | Security requirement(s);
|
|
308
|
-
| `@servers` | Operation-level servers
|
|
309
|
-
| `@externalDocs` | Operation-level external documentation
|
|
310
|
-
| `@callback` | OpenAPI operation callback
|
|
311
|
-
| `@webhook` | Mark the handler as a webhook (`3.1`+ `webhooks` section)
|
|
312
|
-
| `@contentType` | Request content type such as `multipart/form-data`
|
|
313
|
-
| `@examples` | Request, response, and querystring examples
|
|
314
|
-
| `@openapi` | Explicit inclusion marker when `includeOpenApiRoutes` is enabled
|
|
315
|
-
| `@openapi-override` | Deep-merge extra OpenAPI fields onto the operation
|
|
316
|
-
| `@ignore` | Exclude a route from generation
|
|
317
|
-
| `@
|
|
299
|
+
| Tag | Purpose |
|
|
300
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
301
|
+
| `@pathParams` | Path parameter schema or type |
|
|
302
|
+
| `@params` / `@queryParams` | Query parameter schema or type |
|
|
303
|
+
| `@header` / `@cookie` | Header / cookie parameter schema or type |
|
|
304
|
+
| `@body` | Request body schema or type |
|
|
305
|
+
| `@response` | Response schema, code, and optional description |
|
|
306
|
+
| `@responseDescription` | Response description without redefining the schema |
|
|
307
|
+
| `@responseHeader` | Add a response header to a given status code |
|
|
308
|
+
| `@link` | Add an OpenAPI link to a response |
|
|
309
|
+
| `@auth` / `@security` | Security requirement(s); built-in presets: `bearer`, `basic`, `apikey` — configurable via `authPresets` |
|
|
310
|
+
| `@servers` | Operation-level servers |
|
|
311
|
+
| `@externalDocs` | Operation-level external documentation |
|
|
312
|
+
| `@callback` | OpenAPI operation callback |
|
|
313
|
+
| `@webhook` | Mark the handler as a webhook (`3.1`+ `webhooks` section) |
|
|
314
|
+
| `@contentType` | Request content type such as `multipart/form-data` |
|
|
315
|
+
| `@examples` | Request, response, and querystring examples |
|
|
316
|
+
| `@openapi` | Explicit inclusion marker when `includeOpenApiRoutes` is enabled |
|
|
317
|
+
| `@openapi-override` | Deep-merge extra OpenAPI fields onto the operation |
|
|
318
|
+
| `@ignore` | Exclude a route from generation |
|
|
319
|
+
| `@internal` | Exclude a schema/type declaration from `components/schemas` |
|
|
320
|
+
| `@method` | Required HTTP method tag for Pages Router handlers |
|
|
318
321
|
|
|
319
322
|
For the complete tag guide and usage recipes, see
|
|
320
323
|
[docs/jsdoc-reference.md](./docs/jsdoc-reference.md).
|