MCPcopy Create free account
hub / github.com/MariaDB/server / json_valid

Function json_valid

strings/json_lib.c:2292–2299  ·  view source on GitHub ↗

Check if json is valid (well-formed) @retval 0 - success, json is well-formed @retval 1 - error, json is invalid */

Source from the content-addressed store, hash-verified

2290 @retval 1 - error, json is invalid
2291*/
2292int json_valid(const char *js, size_t js_len, CHARSET_INFO *cs, json_engine_t *je)
2293{
2294
2295 json_scan_start(je, cs, (const uchar *) js, (const uchar *) js + js_len);
2296 while (json_scan_next(je) == 0) /* no-op */ ;
2297
2298 return je->s.error == 0;
2299}
2300
2301/*
2302 Expects the JSON object as an js argument, and the key name.

Callers 3

json_normalizeFunction · 0.85
val_boolMethod · 0.85
set_valueMethod · 0.85

Calls 2

json_scan_startFunction · 0.85
json_scan_nextFunction · 0.85

Tested by

no test coverage detected