Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support ignoring tags, without needing a schema #566

Closed
multimeric opened this issue Jul 16, 2020 · 2 comments
Closed

Support ignoring tags, without needing a schema #566

multimeric opened this issue Jul 16, 2020 · 2 comments

Comments

@multimeric
Copy link

I have a complex data model that uses tags, but at the point where js-yaml touches it, I really don't care about the tags. I would like to be able to load the data without manually specifying each and every custom tag I've used as a schema.

Might it be possible to have a PERMISSIVE_SCHEMA that simply takes mapping types and converts them to JS objects, and takes sequence types and converts them to arrays? I suspect this is a somewhat common use-case.

In general, this would be a quick-and-dirty solution to the error:

YAMLException: unknown tag !<!MyTag> at line 8, column 1:
@puzrin
Copy link
Member

puzrin commented Nov 28, 2020

Dupe of #385

@puzrin puzrin closed this as completed Nov 28, 2020
@rlidwka
Copy link
Member

rlidwka commented Dec 25, 2020

You can now construct custom permissive schema, feature added in 73ef02c (currently in dev branch, not released yet).

(example: https://github.com/nodeca/js-yaml/blob/a0d0caa5aa0f5354fefa9c637cfb7c4c17ef7d02/examples/handle_unknown_types.js)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants