mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-21 14:53:44 +01:00
Fix table values constraint in schema validation
This commit is contained in:
parent
d2183f2357
commit
ff7f0e1d2d
@ -318,7 +318,11 @@ function load(self, override, params)
|
||||
end
|
||||
assert((not self.list) or modlib.table.count(override) == #override, "list")
|
||||
end
|
||||
assert((not self.values) or self.values[override], "values")
|
||||
-- Apply the values check only for primitive types where table indexing is by value;
|
||||
-- the `values` field has a different meaning for tables (constraint all values must fulfill)
|
||||
if self.type ~= "table" then
|
||||
assert((not self.values) or self.values[override], "values")
|
||||
end
|
||||
if self.func then self.func(override) end
|
||||
return override
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user