JSON to YAML
This command takes a JSON document and converts it into YAML.
Usage
The json-to-yaml command takes two parameters -input and -output
-
--inputis the JSON document to transform -
--outputis the YAML 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 json-to-yaml command.
From files
Reading and writing to files explicitly
apigee-go-gen transform json-to-yaml \
--input ./examples/snippets/ducks.json \
--output ./out/snippets/ducks.yaml
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