You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Post {
public Int32? Id { get; set; }
public String Title { get; set; }
}
Post post = new Post { Id = null, Title = "Using SharpYaml" };
var result = serializer.Serialize(post);
On the output I get the following:
id: null
title: Using SharpYaml
Is it possible to display an empty string on Id when its value is null, e.g:
id:
title: Using SharpYaml
The text was updated successfully, but these errors were encountered:
That would be useful as for example, in my case, the generated YAML files will be edited afterwards by content editors and having simply "id:" rather than "id:null" is easier to understand.
I was also testing YAMLDotNet and it is rendered as empty string ...
But I think YAMLDotNet has many limitations on configuration so I moved to SharpYaml
I am serializing the following object:
On the output I get the following:
Is it possible to display an empty string on Id when its value is null, e.g:
The text was updated successfully, but these errors were encountered: