MXS-1220: Add JSON Pointer support for json_t objects

Using the JSON Pointer syntax specified in RFC 6901
(https://tools.ietf.org/html/rfc6901) allows for a convenient way to
access values deep in a JSON object.
This commit is contained in:
Markus Mäkelä
2017-05-04 11:00:25 +03:00
parent 432a6d6f28
commit 2f8db4ec1a
4 changed files with 379 additions and 0 deletions

View File

@ -61,4 +61,13 @@ json_t* mxs_json_relationship(const char* host, const char* endpoint);
*/
void mxs_json_add_relation(json_t* rel, const char* id, const char* type);
/**
* @brief Return value at provided JSON Pointer
*
* @param json JSON object
* @param json_ptr JSON Pointer to object
* @return Pointed value or NULL if no value is found
*/
json_t* mxs_json_pointer(json_t* json, const char* json_ptr);
MXS_END_DECLS