如何删除JSON空字符串/值 [英] How to remove JSON empty string/values

查看:289
本文介绍了如何删除JSON空字符串/值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个HTTP请求活动来接收来自我们的webportal的JSON文件。 然后将值传递到存储过程,该过程将数据添加到Azure表中。 唯一的问题是我不想传递NULL /空
文本字符串的字符串值。 有没有办法构建逻辑来删除这些请确保它们不会传递给存储过程?

I have set up an HTTP request activity to receive JSON files from our webportal.  The values are then passed into a stored proc which adds the data to our Azure tables.  The only problem is that I don't want to pass string values which are NULL/empty text strings.  Is there a way to build logic to remove these please to ensure they aren't passed to the stored procedure?

谢谢,

Tony

推荐答案

好的选择是在节点上使用带有属性的JSON序列化程序当object属性为null时忽略。

Good option would be to use JSON serializer with property on the node to ignore when object property is null .

您可以将自定义JSON字符串传递给函数并使用最少量的代码实现逻辑

You can pass your custom JSON string to functions and implement your logic with minimum amount of code

[JsonProperty("property_name", NullValueHandling=NullValueHandling.Ignore)]





这篇关于如何删除JSON空字符串/值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆