Json_doc Parser¶
The Json_doc parser is used for working with data in the JSON format that can be located in any part of the request. The Json_doc parser refers to the top-level JSON data container contents in their raw format.
The Json_doc parser builds a complex data structure on the basis of the input data. You can use the following filters to address the elements of this data structure:
Add the names of the Json_doc parser and the filter provided by it in upper case to the point to use the filter in the point.
Example:
For the
request with the
body, the Json_doc parser applied to the request body refers to the following data:
Json_obj Filter¶
The Json_obj filter refers to the hash table of the JSON objects. The elements of this hash table need to be referred to by using the names of the JSON objects.
Regular expressions in points
The name of the JSON object in the point can be a regular expression of the Ruby programming language.
The Hash filter applied to the JSON data works similarly to the Json_obj.
The values from the hash tables in JSON format may also contain the following complex data structures: arrays and hash tables. Use the following filters to address the elements in these structures:
-
The Array filter or the Json_array filter for arrays
Example:
For the
request with the
body, the Json_obj filter applied to the request body together with the Json_doc parser refers to the following table:
Key | Value |
---|---|
username | user |
rights | read |
-
The
POST_JSON_DOC_JSON_OBJ_username_value
point refers to theuser
value. -
The
POST_JSON_DOC_JSON_OBJ_rights_value
point refers to theread
value.
Json_array Filter¶
The Json_array filter refers to the array of the JSON object values. The elements of this array need to be referred to by using the indexes. The array indexing starts with 0
.
Regular expressions in points
The index in the point can be a regular expression of the Ruby programming language.
The Array filter applied to the JSON data works similarly to the Json_array filter.
The values from the arrays in the JSON format may also contain hash tables. Use the Hash or Json_obj.
Example:
For the
request with the
body, the Json_array filter applied to the rights
JSON object together with the Json_doc parser and the Json_obj filter refers to the following array:
Index | Value |
---|---|
0 | read |
1 | write |
-
The
POST_JSON_DOC_JSON_OBJ_rights_JSON_ARRAY_0_value
point refers to theread
value that corresponds with the0
index from the array of therights
JSON object values addressed by the Json_array filter. -
The
POST_JSON_DOC_JSON_OBJ_rights_JSON_ARRAY_1_value
point refers to thewrite
value that corresponds with the1
index from the array of therights
JSON object values addressed by the Json_array filter.