Check if json is valid (well-formed) @retval 0 - success, json is well-formed @retval 1 - error, json is invalid */
| 2290 | @retval 1 - error, json is invalid |
| 2291 | */ |
| 2292 | int 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. |
no test coverage detected