YAML
yaml to_json <yaml>
Description
Convert a YAML document to JSON (the first document of the text)
Convert a YAML document to JSON (the first document of the text)
Parameters
yaml: The YAML text - String - required
yaml: The YAML text - String - required
admin
yaml to_json "server: host: db.internal port: 5432 ssl: true retention_days: 30 reports: - name: sales cron: '0 6 * * 1' - name: stock cron: '0 7 * * *' updated: 2026-11-03"
mentdb
{"server": {"host": "db.internal", "port": 5432, "ssl": true}, "retention_days": 30, "reports": [{"name": "sales", "cron": "0 6 * * 1"}, {"name": "stock", "cron": "0 7 * * *"}], "updated": "2026-11-03"}
yaml to_json <yaml> <json_params>
Description
Convert YAML to JSON with parameters: all (true: every document separated by --- in an array)
Convert YAML to JSON with parameters: all (true: every document separated by --- in an array)
Parameters
yaml: The YAML text - String - required
json_params: The parameters - String - required
yaml: The YAML text - String - required
json_params: The parameters - String - required
admin
yaml to_json "kind: Service name: api --- kind: Deployment name: api replicas: 3" "{\"all\": true}"
mentdb
[{"kind": "Service", "name": "api"}, {"kind": "Deployment", "name": "api", "replicas": 3}]
json to_yaml <json>
Description
Convert JSON to YAML (block style, the strings that YAML would read as another type are quoted)
Convert JSON to YAML (block style, the strings that YAML would read as another type are quoted)
Parameters
json: The JSON - String - required
json: The JSON - String - required
admin
json to_yaml "{\"server\": {\"host\": \"db.internal\", \"port\": 5432, \"ssl\": true}, \"flags\": [\"yes\", \"no\"], \"comment\": \"a: b\", \"empty\": null}"
mentdb
server: host: db.internal port: 5432 ssl: true flags: - 'yes' - 'no' comment: 'a: b' empty: null
json to_yaml <json> <json_params>
Description
Convert JSON to YAML with parameters: indent (2)
Convert JSON to YAML with parameters: indent (2)
Parameters
json: The JSON - String - required
json_params: The parameters - String - required
json: The JSON - String - required
json_params: The parameters - String - required
admin
json to_yaml "{\"jobs\": {\"build\": {\"steps\": [\"checkout\", \"test\"]}}}" "{\"indent\": 4}"
mentdb
jobs: build: steps: - checkout - test
