diff options
Diffstat (limited to 'teal-src')
-rw-r--r-- | teal-src/prosody/util/jsonschema.tl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/teal-src/prosody/util/jsonschema.tl b/teal-src/prosody/util/jsonschema.tl index 8e5d69bc..fa230cac 100644 --- a/teal-src/prosody/util/jsonschema.tl +++ b/teal-src/prosody/util/jsonschema.tl @@ -295,6 +295,18 @@ function complex_validate (schema : json_schema_object, data : any, root : json_ end end + if schema.dependentRequired then + for k, reqs in pairs(schema.dependentRequired) do + if data[k] ~= nil then + for _, req in ipairs(reqs) do + if data[req] == nil then + return false + end + end + end + end + end + if schema.propertyNames ~= nil then for k in pairs(data) do if not validate(schema.propertyNames, k, root) then |