mirror of
https://github.com/MariaDB/server.git
synced 2025-08-15 22:37:22 +00:00
MDEV-30977: Additional key values are not validating properly when using
unevaluatedProperties with properties declared in subschemas Analysis: When a key fails to validate for "properties" when "properties" is being treated as alternate schema, it needs to fall back on alternate schema for "properites" itself ("unevaluatedProperties" in context of the bug). But that doesn't happen and we end up returning false (=validated) Fix: When "properties" fails to validate as an alternate schema, fall back on alternate schema for "properties" itself.
This commit is contained in:
@ -1883,6 +1883,13 @@ bool Json_schema_properties::validate_as_alternate(const json_engine_t *je,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (alternate_schema && alternate_schema->validate_as_alternate(je, k_start, k_end))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1892,6 +1899,8 @@ Json_schema_additional_and_unevaluated::
|
||||
const uchar* k_start,
|
||||
const uchar* k_end)
|
||||
{
|
||||
if (!allowed)
|
||||
return true;
|
||||
return validate_schema_items(je, &schema_list);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user