From b38fa5219f2f8ae3b6366ab911d9662f9340f70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 3 Sep 2012 17:53:56 +0200 Subject: Set value of a mandatory JSON field to null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- template.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/template.c b/template.c index 6bcca42b..74a87c99 100644 --- a/template.c +++ b/template.c @@ -307,14 +307,9 @@ rsRetVal tplToJSON(struct template *pTpl, msg_t *pMsg, struct json_object **pjso } else { DBGPRINTF("tplToJSON: error %d looking up property\n", localRet); -#if 0 /* TODO: as it looks, there currently is no way to define Null field values in json-c... - we need to think how we will handle that. - */ if(pTpe->data.field.options.bMandatory) { - jsonf = json_object_new(json_type_null); //json_object_new_null(); - json_object_object_add(json, (char*)pTpe->fieldName, jsonf); + json_object_object_add(json, (char*)pTpe->fieldName, NULL); } -#endif } } else { pVal = (uchar*) MsgGetProp(pMsg, pTpe, pTpe->data.field.propid, -- cgit v1.2.3