[sr-dev] git:master:2471d1db: jansson Add explaination of error handling.
Olle E. Johansson
oej at edvina.net
Fri Oct 2 12:35:03 CEST 2015
Module: kamailio
Branch: master
Commit: 2471d1db579089f9e46feabe59830c53ac862e72
URL: https://github.com/kamailio/kamailio/commit/2471d1db579089f9e46feabe59830c53ac862e72
Author: Olle E. Johansson <oej at edvina.net>
Committer: Olle E. Johansson <oej at edvina.net>
Date: 2015-10-02T13:33:46+03:00
jansson Add explaination of error handling.
The pvar remains unchanged if the key/path is not found. Any previous
value remains, and it's not reset to a default value or NULL.
---
Modified: modules/jansson/README
Modified: modules/jansson/doc/jansson_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/2471d1db579089f9e46feabe59830c53ac862e72.diff
Patch: https://github.com/kamailio/kamailio/commit/2471d1db579089f9e46feabe59830c53ac862e72.patch
---
diff --git a/modules/jansson/README b/modules/jansson/README
index c5be0a6..87d28a8 100644
--- a/modules/jansson/README
+++ b/modules/jansson/README
@@ -111,7 +111,9 @@ Chapter 1. Admin Guide
foo.bar[0][1].baz).
The function can put a string, integer, null, or new json string into
- destination.
+ destination. If the key/path can't be found in the JSON data structure,
+ the pvar is not changed. If it had a previous value, that value remains
+ unchanged.
Example 1.1. jansson_get usage
...
diff --git a/modules/jansson/doc/jansson_admin.xml b/modules/jansson/doc/jansson_admin.xml
index b1b0eab..baab686 100644
--- a/modules/jansson/doc/jansson_admin.xml
+++ b/modules/jansson/doc/jansson_admin.xml
@@ -67,13 +67,15 @@
<function moreinfo="none">jansson_get(key/path, src, dst)</function>
</title>
<para>
- Copy the value at the location 'path' from the json object 'src' and store it in pvar 'dst'.
+ Copy the value at the location 'path' from the json object 'src' and store it in pvar 'dst'.
</para>
<para>
The path string supports dot delimited notation (e.g. foo.bar.baz), array notation (e.g. [0]), or a combination of the two (e.g. foo.bar[0][1].baz).
</para>
<para>
The function can put a string, integer, null, or new json string into destination.
+ If the key/path can't be found in the JSON data structure, the pvar is not changed. If it had a previous
+ value, that value remains unchanged.
</para>
<example>
<title><function>jansson_get</function> usage</title>
More information about the sr-dev
mailing list