@welldefined/cli
v0.2.2
Published
[![NPM Version](https://img.shields.io/npm/v/%40welldefined%2Fcli)](https://www.npmjs.com/package/@welldefined/cli)
Downloads
449
Readme
Well Defined 🧼
Command line utilities for creating well-defined OpenAPI specs.
Usage
npx @welldefined/cli [command] path-to-spec.yaml
Alternatively, install it globally with npm
:
npm install @welldefined/cli -g
Then you can use it as welldefined [command] [options]
.
Utilities
merge
Merges two or more YAML files. It treats $ref objects as distinct items in an array.
npx @welldefined/cli merge a.yml b.yml --output c.yaml
change-method
Change HTTP methods in a YAML OpenAPI spec.
npx @welldefined/cli change-method path-to-spec.yaml --from post --to patch --endpoints "*/{id}" --output c.yaml
add-parameter
Adds a parameter to endpoints in a YAML OpenAPI spec.
npx @welldefined/cli add-parameter path-to-spec.yaml --parameter '\$ref: "#/components/parameters/IdempotencyKey"' --methods post,patch,put