YAML to JSON
This command takes a YAML document and converts it into JSON.
Usage
The yaml-to-json
command takes two parameters -input
and -output
-
--input
is the YAML document to transform -
--output
is the JSON document to be created -
--output
full path is created if it does not exist (likemkdir -p
)
You may omit the
--input
or--output
flags to read or write from stdin or stdout
Examples
Below are a few examples for using the yaml-to-json
command.
From files
Reading and writing to files explicitly
apigee-go-gen transform yaml-to-json \
--input ./examples/snippets/ducks.yaml \
--output ./out/snippets/ducks.json
From stdin / stdout
Reading from stdin (from a file) and writing to stdout
From a process
Reading from stdin (piped from another process) and writing to stdout