We can convert an OpenAPI (or Swagger) specification file into JSON using the yamljs utility.
We can install the binary globally command using:
$ npm install -g yamljs
This should make yaml2json available in the shell. We can then run:
$ yaml2json input.yaml -i4 -p > output.json
The output file is the JSON equivalent of the YAML spec.
The -p param means “pretty” and “-i4” means indentation of 4 spaces.