Replies: 2 comments
-
I don't think that you will be able to implement that with YamlDotNet. The parser expects a well-formed stream, and there's currently no way to recover from a syntax error. Short of writing your own parser, I don't have any solution for you. |
Beta Was this translation helpful? Give feedback.
-
If |
Beta Was this translation helpful? Give feedback.
-
I have a bit of Yaml content that contains some json. Yaml looks like this:
The value of "settings" is in fact a json object consumed by an application (Helm deployment on Kubernetes, etc.) Since curly braces are valid separators in yaml, the YamlDotNet deserializer parses the whole settings content and creates nested dictionaries.
Can YamlDotNet disable the further parsing of the value of a property (such as "settings") and return the string value instead?
Background (why I am doing this) - these are configuration files generated by a program and sometimes the json object may contain either Json syntax errors (e.g. comma after value before closing curly brace) or would fail higher-level application validation. I am trying to write a simple tool that validates the generated config at build time without running the whole deployment.
Thanks
F.
Beta Was this translation helpful? Give feedback.
All reactions