Command line utilities for creating well-defined OpenAPI specs.
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]
.
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 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
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
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"