Loading files with unrecognized tags
See original GitHub issueOften I find that I want to be able to load YAML files even if they contain unrecognized tags. Currently, attempting to do so will result in an error, although I’m not sure why that should be the case. Instead of throwing an error for an unrecognized tag, it seems perfectly reasonable to issue a warning and simply return a raw data structure rather than a constructed instance of some type.
The change log says that warnings were changed to errors for unrecognized tags in version 3.4.0. What was the reasoning for this? Are you willing to revert to the old behavior? A better solution might be to add an optional argument to the load*
functions that controls whether unrecognized tags cause warnings or errors.
If this seems like a reasonable approach, I am potentially willing to submit a PR with the necessary changes.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
I’m here just to mention that the requested feature is a very typical use case for someone who simply wants to load a yaml file with some tags to only change a few parameters and dump the data again. As an example, I hit that problem with
unrecognized tags
when tried to load my AWS CloudFormation template which contains!Ref
and!GetAtt
tags to only change a few parameters and dump it again. Please, consider the original request and maybe reopen the issue.@andrewryan1906 no, I used other approaches. First, I used awk to edit original template and it worked fine but then I realised that CloudFormation Parameters is the cleanest way to solve my task.