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
-
--inputis the YAML document to transform -
--outputis the JSON document to be created -
--outputfull path is created if it does not exist (likemkdir -p)
You may omit the
--inputor--outputflags 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