Browse code

prevent jansson from shuffling key order in json

(cherry picked from commit 140d0c6fc89d3c72bbd45627ca627e19e45b4e53)

kelchy authored on 06/07/2015 11:21:41 • Daniel-Constantin Mierla committed on 17/07/2015 10:25:39
Showing 1 changed files
... ...
@@ -33,7 +33,7 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) {
33 33
 	val->flags = 0;
34 34
 
35 35
 	if(json_is_object(v) || json_is_array(v)) {
36
-		const char* value = json_dumps(v, JSON_COMPACT);
36
+		const char* value = json_dumps(v, JSON_COMPACT|JSON_PRESERVE_ORDER);
37 37
 		*freeme = (char*)value;
38 38
 		val->rs.s = (char*)value;
39 39
 		val->rs.len = strlen(value);