-
-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yaml deserialization to update a key value, results in completely different serialization, without double-quotes #449
Comments
If you could properly enclose your code blocks between code fences (three backtick characters), it would be easier to read your question. |
Please refer to #428 if you want to force quotes on strings. |
I'm also seeing the >2- in some strings, as well as >+ and >-. For me, it tends to happen when I'm trying to embed powershell in YAML, (GitHub Actions), for example:
will produce:
|
Would this ForceQuotedStringValuesEventEmitter also work in deserializing a swagger yaml and preserving the quotes to later serialize it again? |
@samsmithnz the @jobzombi ForceQuotedStringValuesEventEmitter does not preserve the quotes. Instead it forces them. Therefore it should work regardless of the source of the data. |
Sorry I didn't mean to close this issue, but the GitHub UI on mobile makes it really easy to click by mistake. |
I have the following yaml:
I am able to use yamldotnet to deserialize it:
I update the value that needs to be flipped to false and then serialize it back to write to a file, but the serialized output is the following:
It is adding a ">2-" to certain lines, eg fifth to last line and all non-boolean values lost the double-quotes. The product ingesting the yaml file requires the double quotes as part of the string value it reads. Having trouble using the SerializerBuilder to account for this and I have no clue why I am getting that ">2-". When I outout the value for that field though there is a new-line before the value, so wondering if it is some kind of new-line character. It has no effect on the future deserialization of the yaml, but am concerned it will have issues down the line with the intake of the yaml by the receiving application.
The text was updated successfully, but these errors were encountered: