sndev.io / docs

openapi

Ingest an OpenAPI/Swagger spec into sys_openapi and generate per-tag manifests.

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.

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

NameRequiredDescription
file|url|--YesPath to a .json/.yaml spec, a URL, or - to read from stdin.

Flags

FlagDefaultDescription
--tags <list>Comma-separated tag filter.
--include <pattern>Include matching endpoints ("METHOD /path"). Repeatable.
--exclude <pattern>Exclude matching endpoints. Repeatable.
--scope <scope>globalTarget app scope, e.g. global or x_<vendor>_<product>.
--output <dir>./output/<api-slug>/Output directory.
--dry-runPrint summary without writing files.
--diffCompare 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.yaml
Parsed 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