Hi
I want to the empty property in my Json to not show up
Current output
{"fields":{"sum":"Test","pro":{"ke":"T"},"itp":{"id":"10"},"cust":{"id":"13"},"cust7":{}}}
Expected
{"fields":{"sum":"Test","pro":{"ke":"T"},"itp":{"id":"10"},"cust":{"id":"13"}}}
I tried things as suggested here...
My Code
public static string JiraStructureForCreate(Era eraRequest)
{
var tudhjs = new
{
fields = new
{
sum = "st",
pro = new
{
ke = "T"
},
itp = new
{
id = "35"
},
cust = new
{
id = "23"
},
cust7 = new
{
value = ""
}
}
};
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
var myJson = JsonConvert.SerializeObject(tudhjs, settings);