YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

Yaml string not serialized as multiline string

Open asrosent opened this issue 5 years ago • 0 comments

Hey aaubry, I think I might have found a small bug.

I have a use case where i need to serialize a Yaml string as a property of another string.

the string is the following: "defaultMetricAllow: false\r\ndefaultDimensionsAllow: true\r\nstartsWithFilters:\r\n- overlay_\r\n- descheduler_\r\nmetrics:\r\n node_cpu_usage: \r\n node_disk_read_bytes_total_rate: \r\n container_cpu_usage: \r\n pod_memory_usage: \r\n node_status: \r\n"

which in translates to:

image

I have a class that is wrapping this value image

My expected behaviour: object should be serialized as

Value: |- defaultMetricAllow: false defaultDimensionsAllow: true etc...

Actual behaviour: object is serialized as

Value: "defaultMetricAllow: false\r\ndefaultDimensionsAllow: true\r\nstartsWithFilters:\r\n- overlay_\r\n- descheduler_\r\nmetrics:\r\n node_cpu_usage: \r\n node_disk_read_bytes_total_rate: \r\n container_cpu_usage: \r\n pod_memory_usage: \r\n node_status: \r\n"

thanks! asaf.

asrosent avatar Jun 01 '20 14:06 asrosent