Closed groundnuty closed 4 years ago
Would it be better to use a dispatch table based on extension? I could certainly see including JSON files into OpenAPI or RAML specification documents. (Or even just wanting to add .raml
to the set of extensions recognized as YAML.)
Thanks for the advice and the PR, it's a good idea.
Such a feature is started on https://github.com/tanbro/pyyaml-include/tree/feature/non-yaml-files
I have a use case when I want to include a bash code or a JSON file into the yaml as strings. When loading everything as YAML such include results with an error. Adding a wildcard to load
*.yaml
or*.yml
files with YAML loader and others read as plain string solves the issue.