lua-LIVR


Overview

lua-LIVR is a lightweight validator supporting Language Independent Validation Rules Specification (LIVR).

Features:

  • Rules are declarative and language independent
  • Any number of rules for each field
  • Return together errors for all fields
  • Excludes all fields that do not have validation rules described
  • Has possibility to validatate complex hierarchical structures
  • Easy to describe and undersand rules
  • Returns understandable error codes(not error messages)
  • Easy to add own rules
  • Multipurpose (user input validation, configs validation, contracts programming etc)

References

The LIVR specifications are available on https://livr-spec.org/.

Status

lua-LIVR is now stable.

It's developed for Lua 5.1, 5.2, 5.3 & 5.4.

Download

lua-LIVR source can be downloaded from Framagit.

Installation

lua-LIVR have two optional dependencies lua-utf8 & Lrexlib-PCRE.

lua-LIVR is available via LuaRocks:

luarocks install lua-livr

lua-LIVR is available via opm:

opm get fperrad/lua-livr

or manually, with:

make install

Test

The test suite requires the modules lua-TestAssertion, dkjson & LuaFileSystem.

make test

Copyright © 2018-2023 François Perrad

This library is licensed under the terms of the MIT/X11 license, like Lua itself.