43#define REGEX_YMD "[0-9]{4}-[01][0-9]-[0-3][0-9]"
47#define REGEX_HMS "[0-2][0-9]:[0-5][0-9](:[0-6][0-9](.[0-9]+)?)?"
50#define REGEX_TZ "(Z|[-+][0-2][0-9](:?[0-5][0-9])?)"
53#define ISO8601_PATTERN "^" REGEX_YMD "(T" REGEX_HMS REGEX_TZ ")?$"
66 if (expected != actual) {
84 if (v < minval || maxval < v) {
85 ast_log(
LOG_ERROR,
"Value out of range. Expected %jd <= %jd <= %jd\n", minval, v, maxval);
124 return check_range(-2147483648LL, 2147483647LL, json);
178 "Array member %zu failed validation\n", i);
190 REG_EXTENDED | REG_ICASE | REG_NOSUB);
Generated file - Build validators for ARI model objects.
Asterisk main include file. File version handling, generic pbx functions.
Support for logging to various files, console and syslog Configuration in file logger....
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
const char * ast_json_typename(enum ast_json_type type)
Get the string name for the given type.
ast_json_type
Valid types of a JSON element.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
int ast_ari_validate_float(struct ast_json *json)
Validator for native Swagger float.
int ast_ari_validate_object(struct ast_json *json)
Validator for native Swagger object.
int ast_ari_validate_int(struct ast_json *json)
Validator for native Swagger int.
int ast_ari_validate_long(struct ast_json *json)
Validator for native Swagger long.
int ast_ari_validate_byte(struct ast_json *json)
Validator for native Swagger byte.
static regex_t date_regex
static int check_type(struct ast_json *json, enum ast_json_type expected)
int ast_ari_validate_string(struct ast_json *json)
Validator for native Swagger string.
int ast_ari_validate_boolean(struct ast_json *json)
Validator for native Swagger boolean.
static int check_range(intmax_t minval, intmax_t maxval, struct ast_json *json)
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
int ast_ari_validate_double(struct ast_json *json)
Validator for native Swagger double.
int ast_ari_validate_date(struct ast_json *json)
Validator for native Swagger date.
static int load_module(void)
static int unload_module(void)
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
Abstract JSON element (object, array, string, int, ...).