@welldefined/cli
v0.3.2
Published
[](https://www.npmjs.com/package/@welldefined/cli)
Readme
Well Defined 🧼
Command line utilities for creating well-defined OpenAPI specs.
Usage
npx @welldefined/cli [command] path-to-spec.yamlAlternatively, install it globally with npm:
npm install @welldefined/cli -gThen 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.yamlchange-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.yamladd-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,putchange-response-status
Change response status codes in a YAML OpenAPI spec. The status changed to MUST NOT already be in the endpoint's responses.
npx @welldefined/cli change-response-status path-to-spec.yaml --from 202 --to 200 --endpoints "*/{id}" --methods "post"