sndev.io / docs

swagger

Generate manifests from a Swagger/OpenAPI spec.

The swagger command reads a Swagger 2.0 or OpenAPI 3.x spec and generates a manifest.ts with REST message and flow action steps for each endpoint.
sn swagger <spec>

Generate manifests from Swagger/OpenAPI spec.

Arguments

NameRequiredDescription
specYesPath to a .json or .yaml Swagger/OpenAPI spec file.

Examples

sn swagger ./petstore.yaml
Parsed 12 endpoints from petstore.yaml
Generated manifest.ts (12 steps)
REST message: Petstore API
Flow actions: listPets, createPet, deletePet, ...
sn openapi is an alias for this command — both accept the same arguments.