Zuplo
Zuplo CLI

Zuplo CLI: OpenAPI Merge

Merge an OpenAPI file into your Zuplo project
TerminalCode
zuplo oas merge --source <file|url> --destination <file> [options]

Common use cases

Importing an existing OpenAPI file

The command supports importing both JSON and YAML formats. The format is inferred from the file extension.

TerminalCode
zuplo openapi merge --source /path/to/openapi.json zuplo openapi merge --source /path/to/openapi.yaml

When no --destination option is provided, the OpenAPI file is automatically merged into routes.oas.json.

To import a remote file, use the --source option with a URL. The command downloads the file to a temporary directory and imports it.

TerminalCode
zuplo openapi merge --source https://example.com/path/to/openapi.json

To rename the destination file, use the --destination option.

TerminalCode
zuplo openapi merge --source https://example.com/path/to/openapi.json --destination new-name

Examples

Merge an OpenAPI file into your Zuplo project

TerminalCode
zuplo oas merge --source openapi.yaml --destination ./config/routes.oas.json

Merge an OpenAPI file from a URL

TerminalCode
zuplo oas merge -s https://api.example.com/openapi.json -d ./config/api.oas.json

Merge using operation-id instead of path-method matching

TerminalCode
zuplo oas merge --source openapi.yaml --destination ./config/routes.oas.json --merge-mode operation-id

Options

--source

The OpenAPI file to merge (file path or URL)

Type: stringAlias: -s

--destination

The destination file name (must end with .oas.json)

Type: stringDefault: "./config/routes.oas.json"Alias: -d

--merge-mode

The merge mode to use when merging the OpenAPI file

Type: stringDefault: "path-method"Choices: path-method, operation-idAlias: -m

Global options

The following global options are available for all commands:

Last modified on