是否有可能使用默认的JsonBuilder库在Groovy中创建JSON值,以排除对象中的所有null值?就像Java中的Jackson通过注释类来排除null值一样。
例如:
{
"userId": "25",
"givenName": "John",
"familyName": null,
"created": 1360080426303
}
应该打印为:
{
"userId": "25",
"givenName": "John",
"created": 1360080426303
}