X-Git-Url: https://git.exim.org/users/heiko/exim.git/blobdiff_plain/e73798976812e652320f096870359ef35ed069ff..7f69e814219268610c9d5c9b724f64a17a78b2cb:/doc/doc-docbook/spec.xfpt diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index c40cf23f8..22f06e3c1 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -9537,6 +9537,8 @@ This forces an expansion failure (see section &<>&); {<&'string2'&>} must be present for &"fail"& to be recognized. .vitem "&*${extract json{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& + {*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& {*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON object" .cindex JSON expansions @@ -9551,8 +9553,13 @@ The expanded <&'string1'&> must be of the form: The braces, commas and colons, and the quoting of the member name are required; the spaces are optional. Matching of the key against the member names is done case-sensitively. -If a returned value is a JSON string, it retains its leading and +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed from the returned value. +.wen . XXX should be a UTF-8 compare The results of matching are handled as above. @@ -9589,7 +9596,9 @@ yields &"99"&. Two successive separators mean that the field between them is empty (for example, the fifth field above). -.vitem "&*${extract json{*&<&'number'&>&*}}&&& +.vitem "&*${extract json {*&<&'number'&>&*}}&&& + {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'number'&>&*}}&&& {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON array" .cindex JSON expansions @@ -9598,8 +9607,13 @@ apart from leading and trailing white space, which is ignored. Field selection and result handling is as above; there is no choice of field separator. -If a returned value is a JSON string, it retains its leading and +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed from the returned value. +.wen .vitem &*${filter{*&<&'string'&>&*}{*&<&'condition'&>&*}}*& @@ -11327,6 +11341,25 @@ being processed, to enable these expansion items to be nested. To scan a named list, expand it with the &*listnamed*& operator. +.new +.vitem "&*forall_json{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forany_json{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forall_jsons{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forany_jsons{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" +.cindex JSON "iterative conditions" +.cindex JSON expansions +.cindex expansion "&*forall_json*& condition" +.cindex expansion "&*forany_json*& condition" +.cindex expansion "&*forall_jsons*& condition" +.cindex expansion "&*forany_jsons*& condition" +As for the above, except that the first argument must, after expansion, +be a JSON array. +The array separator is not changeable. +For the &"jsons"& variants the elements are expected to be JSON strings +and have their quotes removed before the evaluation of the condition. +.wen + + .vitem &*ge&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& &&& &*gei&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&