blob: 59fb58b2a6e7d7f89466a13160dd0b23927ad14a [file] [log] [blame]
Lawrence Tang8a2d7372022-07-12 16:44:49 +01001#ifndef JSON_SCHEMA_H
2#define JSON_SCHEMA_H
3
Lawrence Tang5202bbb2022-08-12 14:54:36 +01004#include <json.h>
Lawrence Tang8a2d7372022-07-12 16:44:49 +01005
John Chungf8fc7052024-05-03 20:05:29 +08006#define JSON_SCHEMA_VERSION "https://json-schema.org/draft/2020-12/schema"
Lawrence Tang8f793ac2022-07-13 10:17:09 +01007#define JSON_ERROR_MSG_MAX_LEN 512
Lawrence Tang8a2d7372022-07-12 16:44:49 +01008
John Chungf8fc7052024-05-03 20:05:29 +08009int validate_schema(json_object *schema, char *schema_directory,
10 json_object *object, char *error_message);
11int validate_schema_from_file(const char *schema_file, json_object *object,
12 char *error_message);
Lawrence Tang8f793ac2022-07-13 10:17:09 +010013void validate_schema_debug_enable();
14void validate_schema_debug_disable();
Lawrence Tang8a2d7372022-07-12 16:44:49 +010015
John Chungf8fc7052024-05-03 20:05:29 +080016#endif