leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.12k stars 247 forks source link

Clarify table limitation on custom validation functions #723

Closed TangentFoxy closed 3 years ago

TangentFoxy commented 3 years ago

Tables are unpacked to allow multiple arguments to be specified, which means a single table cannot be passed as THE argument.

I was attempting to pass a hash table as an argument to a validation function, but as a table passed as an argument to a validation function is passed through unpack, my hash table was sent as zero arguments instead. I understand why it works this way, but it was frustrating to find out the hard way I could not do what I intended.

leafo commented 3 years ago

Thanks