Lines Matching full:schema
43 static bool ucl_schema_validate (const ucl_object_t *schema,
149 ucl_schema_validate_object (const ucl_object_t *schema, in ucl_schema_validate_object() argument
160 while (ret && (elt = ucl_object_iterate (schema, &iter, true)) != NULL) { in ucl_schema_validate_object()
185 "additionalProperties attribute is invalid in schema"); in ucl_schema_validate_object()
196 "required attribute is invalid in schema"); in ucl_schema_validate_object()
246 /* Check if we have exactly the same properties in schema and object */ in ucl_schema_validate_object()
248 prop = ucl_object_lookup (schema, "properties"); in ucl_schema_validate_object()
253 pat = ucl_object_lookup (schema, "patternProperties"); in ucl_schema_validate_object()
304 ucl_schema_validate_number (const ucl_object_t *schema, in ucl_schema_validate_number() argument
313 while (ret && (elt = ucl_object_iterate (schema, &iter, true)) != NULL) { in ucl_schema_validate_number()
335 test = ucl_object_lookup (schema, "exclusiveMaximum"); in ucl_schema_validate_number()
351 test = ucl_object_lookup (schema, "exclusiveMinimum"); in ucl_schema_validate_number()
370 ucl_schema_validate_string (const ucl_object_t *schema, in ucl_schema_validate_string() argument
381 while (ret && (elt = ucl_object_iterate (schema, &iter, true)) != NULL) { in ucl_schema_validate_string()
484 ucl_schema_validate_array (const ucl_object_t *schema, in ucl_schema_validate_array() argument
496 while (ret && (elt = ucl_object_iterate (schema, &iter, true)) != NULL) { in ucl_schema_validate_array()
513 /* Validate all items using the specified schema */ in ucl_schema_validate_array()
521 "items attribute is invalid in schema"); in ucl_schema_validate_array()
539 "additionalItems attribute is invalid in schema"); in ucl_schema_validate_array()
630 "Type attribute is invalid in schema"); in ucl_schema_type_is_allowed()
738 * Find reference schema
883 ucl_schema_validate_values (const ucl_object_t *schema, const ucl_object_t *obj, in ucl_schema_validate_values() argument
889 elt = ucl_object_lookup (schema, "maxValues"); in ucl_schema_validate_values()
905 elt = ucl_object_lookup (schema, "minValues"); in ucl_schema_validate_values()
929 ucl_schema_validate (const ucl_object_t *schema, in ucl_schema_validate() argument
939 if (schema->type != UCL_OBJECT) { in ucl_schema_validate()
940 ucl_schema_create_error (err, UCL_SCHEMA_INVALID_SCHEMA, schema, in ucl_schema_validate()
941 "schema is %s instead of object", in ucl_schema_validate()
942 ucl_object_type_to_string (schema->type)); in ucl_schema_validate()
950 if (!ucl_schema_validate_values (schema, obj, err)) { in ucl_schema_validate()
954 if (!ucl_schema_validate (schema, cur, false, err, root, external_refs)) { in ucl_schema_validate()
961 elt = ucl_object_lookup (schema, "enum"); in ucl_schema_validate()
968 elt = ucl_object_lookup (schema, "allOf"); in ucl_schema_validate()
979 elt = ucl_object_lookup (schema, "anyOf"); in ucl_schema_validate()
997 elt = ucl_object_lookup (schema, "oneOf"); in ucl_schema_validate()
1015 elt = ucl_object_lookup (schema, "not"); in ucl_schema_validate()
1026 elt = ucl_object_lookup (schema, "$ref"); in ucl_schema_validate()
1041 elt = ucl_object_lookup (schema, "type"); in ucl_schema_validate()
1048 return ucl_schema_validate_object (schema, obj, err, root, external_refs); in ucl_schema_validate()
1051 return ucl_schema_validate_array (schema, obj, err, root, external_refs); in ucl_schema_validate()
1055 return ucl_schema_validate_number (schema, obj, err); in ucl_schema_validate()
1058 return ucl_schema_validate_string (schema, obj, err); in ucl_schema_validate()
1068 ucl_object_validate (const ucl_object_t *schema, in ucl_object_validate() argument
1071 return ucl_object_validate_root_ext (schema, obj, schema, NULL, err); in ucl_object_validate()
1075 ucl_object_validate_root (const ucl_object_t *schema, in ucl_object_validate_root() argument
1080 return ucl_object_validate_root_ext (schema, obj, root, NULL, err); in ucl_object_validate_root()
1084 ucl_object_validate_root_ext (const ucl_object_t *schema, in ucl_object_validate_root_ext() argument
1097 ret = ucl_schema_validate (schema, obj, true, err, root, ext_refs); in ucl_object_validate_root_ext()