YAML to JSON
yaml_to_jsonConvert YAML to JSON while safely rejecting code tags and blocking alias bombs, with multi-document files returned as a JSON array.
Instructions
Convert YAML to JSON (YAML 1.2 core schema plus anchors/aliases, << merge keys, timestamps, multi-document files). Safe: no code tags (!!js/function, !!python… are rejected), alias bombs and recursive aliases are stopped. Several documents become a JSON array. Errors give line and column. Give "text" or a file "path". Web version: https://s3eidat.github.io/yaml-json/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Or: a path to a YAML file (UTF-8; use this for big inputs). | |
| text | No | The YAML as inline text. | |
| indent | No | Indentation: 2 or 4 spaces. | |
| output | No | Optional: also write the result to this file path (or folder ending in "/"). The result text is then left out of the reply. Results over 1,000,000 characters are always written to a file. | |
| sortKeys | No | Sort object keys alphabetically at every level. | |
| alwaysArray | No | Always output an array of documents, even for one document. |