aboutsummaryrefslogtreecommitdiffstats
path: root/util/jsonschema.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/jsonschema.lua')
-rw-r--r--util/jsonschema.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/util/jsonschema.lua b/util/jsonschema.lua
index b285feb4..4ace2d2d 100644
--- a/util/jsonschema.lua
+++ b/util/jsonschema.lua
@@ -205,6 +205,19 @@ type_validators.table = function(schema, data)
end
end
+ if schema.contains then
+ local found = false
+ for i = 1, #data do
+ if validate(schema.contains, data[i]) then
+ found = true
+ break
+ end
+ end
+ if not found then
+ return false
+ end
+ end
+
return true
end
return false