The openapi command reads a Swagger 2.0 or OpenAPI 3.x spec (file, URL, or stdin via -), uploads it to the instance's sys_openapi record, and generates one manifest per tag with REST message + flow action steps. --diff mode compares an incoming spec against an existing upload without writing anything.
openapi
Ingest an OpenAPI/Swagger spec into sys_openapi and generate per-tag manifests.
sn openapi <file|url|--> [--tags <list>] [--include <pattern>] [--exclude <pattern>]
[--scope <scope>] [--output <dir>] [--dry-run]
[--diff] [--name <name>] [--version <v>] Ingest OpenAPI spec; generate manifests.
Arguments
| Name | Required | Description |
|---|---|---|
| file|url|-- | Yes | Path to a .json/.yaml spec, a URL, or - to read from stdin. |
Flags
| Flag | Default | Description |
|---|---|---|
| --tags <list> | — | Comma-separated tag filter. |
| --include <pattern> | — | Include matching endpoints ("METHOD /path"). Repeatable. |
| --exclude <pattern> | — | Exclude matching endpoints. Repeatable. |
| --scope <scope> | global | Target app scope, e.g. global or x_<vendor>_<product>. |
| --output <dir> | ./output/<api-slug>/ | Output directory. |
| --dry-run | — | Print summary without writing files. |
| --diff | — | Compare incoming spec against existing sys_openapi record. Read-only — no upload, no manifest generation. |
| --name <name> | — | Override lookup name (default: spec info.title). |
| --version <v> | — | Pin to a specific existing version (default: latest). |
Examples
sn openapi ./petstore.yamlParsed 12 endpoints from petstore.yaml
Generated 3 manifest(s):
./output/petstore/pets/manifest.ts (5 steps)
./output/petstore/store/manifest.ts (4 steps)
./output/petstore/user/manifest.ts (3 steps)
sn openapi ./v2-draft.yaml --diff