--- a/teal-src/prosody/util/jsonschema.tl Sat Apr 22 12:48:51 2023 +0200
+++ b/teal-src/prosody/util/jsonschema.tl Sat Apr 22 13:30:19 2023 +0200
@@ -309,6 +309,9 @@
end
if data is table then
+ -- tables combine object and array behavior, thus we do both kinds of
+ -- validations in this block, which could be useful for validating Lua
+ -- tables
if schema.maxItems and #data > schema.maxItems then
return false
@@ -339,6 +342,7 @@
end
if schema.propertyNames ~= nil then
+ -- could be used to validate non-string keys of Lua tables
for k in pairs(data) do
if not validate(schema.propertyNames, k, root) then
return false