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.
Code
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.
Code
To rename the destination file, use the --destination option.
Code
Examples
Merge an OpenAPI file into your Zuplo project
Merge an OpenAPI file from a URL
Merge using operation-id instead of path-method matching
Merge and prepend '/v1' to all paths
Watch the source file for changes and automatically re-merge
Options
--source
The OpenAPI file to merge (file path or URL)
stringAlias: -s--destination
The destination file name (must end with .oas.json)
stringDefault: "./config/routes.oas.json"Alias: -d--merge-mode
The merge mode to use when merging the OpenAPI file
stringDefault: "path-method"Choices: path-method, operation-idAlias: -m--prepend-path
Directly provide a path to prepend to all paths (e.g., '/v1')
string--server-paths
Prepend the pathname from the first server URL to all paths
booleanDefault: true--watch
Watch source file for changes and automatically re-merge
booleanDefault: falseGlobal options
The following global options are available for all commands: