@welldefined/cli

0.3.2 • Public • Published

Well Defined 🧼

NPM Version

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

change-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"

Dependents (0)

Package Sidebar

Install

npm i @welldefined/cli

Weekly Downloads

11

Version

0.3.2

License

MIT

Unpacked Size

39.9 kB

Total Files

20

Last publish

Collaborators

  • mtso0