Lawrence Tang | 8a2d737 | 2022-07-12 16:44:49 +0100 | [diff] [blame] | 1 | #ifndef JSON_SCHEMA_H |
| 2 | #define JSON_SCHEMA_H |
| 3 | |
Lawrence Tang | 5202bbb | 2022-08-12 14:54:36 +0100 | [diff] [blame] | 4 | #include <json.h> |
Lawrence Tang | 8a2d737 | 2022-07-12 16:44:49 +0100 | [diff] [blame] | 5 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 6 | #define JSON_SCHEMA_VERSION "https://json-schema.org/draft/2020-12/schema" |
Lawrence Tang | 8f793ac | 2022-07-13 10:17:09 +0100 | [diff] [blame] | 7 | #define JSON_ERROR_MSG_MAX_LEN 512 |
Lawrence Tang | 8a2d737 | 2022-07-12 16:44:49 +0100 | [diff] [blame] | 8 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 9 | int validate_schema(json_object *schema, char *schema_directory, |
| 10 | json_object *object, char *error_message); |
| 11 | int validate_schema_from_file(const char *schema_file, json_object *object, |
| 12 | char *error_message); |
Lawrence Tang | 8f793ac | 2022-07-13 10:17:09 +0100 | [diff] [blame] | 13 | void validate_schema_debug_enable(); |
| 14 | void validate_schema_debug_disable(); |
Lawrence Tang | 8a2d737 | 2022-07-12 16:44:49 +0100 | [diff] [blame] | 15 | |
John Chung | f8fc705 | 2024-05-03 20:05:29 +0800 | [diff] [blame] | 16 | #endif |