Commit ef333ee770f743a4ffcbe8f571acca40a96d5d1a
1 parent
64fc7e3c
add json_object function with type_name of the object. Hence that function will …
…automatically add a json member with name "obj_type". This function help to find the right object in the json tree
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
web/CXM_json.anubis
| ... | ... | @@ -45,6 +45,14 @@ public define Printable_tree |
| 45 | 45 | //------------------------------- |
| 46 | 46 | // helpers |
| 47 | 47 | |
| 48 | +public define JsonValue | |
| 49 | + json_object | |
| 50 | + ( | |
| 51 | + String type_name, | |
| 52 | + List(JsonMember) members | |
| 53 | + )= | |
| 54 | + json_object([json_member("obj_type", json_string(type_name)) . members]). | |
| 55 | + | |
| 48 | 56 | public define JsonMember |
| 49 | 57 | json_member |
| 50 | 58 | ( | ... | ... |