Method now returns the content of Json Arrays, if it is specified in Json Path
as String. The start and end character is a square bracket.
Any complex object in the array is returned as Json, so that you might get
Arrays of Array or objects. Only recommended for Arrays
of simple types (e.g., String or int) which will be returned as CSV String.
---
src/sample.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/sample.c b/src/sample.c
index 07c881dcf..ecc4a961d 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -4159,8 +4159,16 @@ static int sample_conv_json_query(const struct arg
*args, struct sample *smp, vo
return 1;
}
- case MJSON_TOK_NULL:
case MJSON_TOK_ARRAY:
+ // We copy the complete array, including square
brackets into the return buffer
+ // result looks like:
["manage-account","manage-account-links","view-profile"]
+ strncpy( trash->area, token, token_size);
+ trash->data = token_size;
+ trash->size = token_size;
+ smp->data.u.str = *trash;
+ smp->data.type = SMP_T_STR;
+ return 1;
+ case MJSON_TOK_NULL:
case MJSON_TOK_OBJECT:
/* We cannot handle these. */
return 0;
--
2.39.3
[X]
An Elisa camLine Holding GmbH company - www.camline.com
camLine GmbH - Fraunhoferring 9, 85238 Petershausen, Germany
Amtsgericht München HRB 88821
Managing Directors: Frank Bölstler, Evelyn Tag, Bernhard Völker
The content of this message is CAMLINE CONFIDENTIAL. If you are not the
intended recipient, please notify me, delete this email and do not use or
distribute this email.