-
New
lengthrule added to theRegistry. This rule checks that the length of a data field is exactly equal to the value specified by thelengthschema field. This removes the need to specify both amin_lengthandmax_lengthwith the same value when enforcing an exact length. -
New
length_and_min_lengthandlength_and_max_lengthcross rules added to theRegistry. These rules check that themin_lengthandmax_lengthrules are not specified when alengthrule is present. -
The
coercerule now accepts functions with multiple arguments when passed directly to aSchemaorValidator, allowing baseas.*()functions to be used ascoercerules in schema definitions. However, only the field value is passed to the function; any additional arguments are ignored. Functions with multiple arguments still cannot be added to theRegistry@coerce_map, asadd_coerce_rule()enforces a strict one-argument function signature.
-
Fixed the
allowed_type_mismatchandforbidden_type_mismatchcross rules so that they use theRegistry@type_mapto obtain the function used for type checking whentypeis a string, and use the supplied function directly whentypeis a function. Previously, function-valuedtypefields caused an error, while character-valuedtypefields could result in incorrect type checking because the class of theallowed/forbiddenfield was compared directly with thetypefield. This could produce false positives, such as an integerallowed/forbiddenfield being flagged as a type mismatch whentypewas "numeric". -
Fixed incorrect argument-count checking for the
type,predicate, andapplyrules.
- Initial CRAN submission.