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);
Asterisk main include file. File version handling, generic pbx functions.
int ast_ari_validate_void(struct ast_json *json)
Validator for native Swagger void.
int ast_ari_validate_long(struct ast_json *json)
Validator for native Swagger long.
ast_json_type
Valid types of a JSON element.
int ast_ari_validate_float(struct ast_json *json)
Validator for native Swagger float.
static regex_t date_regex
Generated file - Build validators for ARI model objects.
int ast_ari_validate_byte(struct ast_json *json)
Validator for native Swagger byte.
static int load_module(void)
static int check_type(struct ast_json *json, enum ast_json_type expected)
int ast_ari_validate_double(struct ast_json *json)
Validator for native Swagger double.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
int ast_ari_validate_date(struct ast_json *json)
Validator for native Swagger date.
int ast_ari_validate_object(struct ast_json *json)
Validator for native Swagger object.
static int check_range(intmax_t minval, intmax_t maxval, struct ast_json *json)
int ast_ari_validate_int(struct ast_json *json)
Validator for native Swagger int.
int ast_ari_validate_boolean(struct ast_json *json)
Validator for native Swagger boolean.
enum ast_json_type ast_json_typeof(const struct ast_json *value)
Get the type of value.
Module has failed to load, may be in an inconsistent state.
const char * ast_json_typename(enum ast_json_type type)
Get the string name for the given type.
Support for logging to various files, console and syslog Configuration in file logger.conf.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
size_t ast_json_array_size(const struct ast_json *array)
Get the size of a JSON array.
Abstract JSON element (object, array, string, int, ...).
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
int ast_ari_validate_list(struct ast_json *json, int(*fn)(struct ast_json *))
Validator for a Swagger List[]/JSON array.
struct ast_json * ast_json_array_get(const struct ast_json *array, size_t index)
Get an element from an array.
int ast_ari_validate_string(struct ast_json *json)
Validator for native Swagger string.
static int unload_module(void)