Module: kamailio
Branch: master
Commit: 9866f62c462075db1d0ac4fb20a35fe13c7d2c4d
URL:
https://github.com/kamailio/kamailio/commit/9866f62c462075db1d0ac4fb20a35fe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-06T14:26:22+02:00
Merge pull request #232 from kelchy/master
jansson: prevent from shuffling key order in json
---
Modified: modules/jansson/jansson_utils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9866f62c462075db1d0ac4fb20a35fe…
Patch:
https://github.com/kamailio/kamailio/commit/9866f62c462075db1d0ac4fb20a35fe…
---
diff --git a/modules/jansson/jansson_utils.c b/modules/jansson/jansson_utils.c
index 85f87ad..4919b0e 100644
--- a/modules/jansson/jansson_utils.c
+++ b/modules/jansson/jansson_utils.c
@@ -33,7 +33,7 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) {
val->flags = 0;
if(json_is_object(v) || json_is_array(v)) {
- const char* value = json_dumps(v, JSON_COMPACT);
+ const char* value = json_dumps(v, JSON_COMPACT|JSON_PRESERVE_ORDER);
*freeme = (char*)value;
val->rs.s = (char*)value;
val->rs.len = strlen(value);