Releases: tminglei/form-binder
Releases · tminglei/form-binder
v0.12.2
v0.12.1
v0.12.0
Refactoring:
- move misc interfaces/classes from
Framework
to package file - intelligently detect label key and remove
i18n
option (p.s. labels starting with@
will be used as message key) - rename option items
ignoreEmpty/touched
toskipUntouched/touchedChecker
(!!! broken changes)
v0.11.0
v0.10.1
v0.10.0
Code refactor inspired by form-binder-java
:
- remove
InputMode
as type parameter ofMapping
/Constraint
/PreProcessor
s. Currently all constraints/pre-processors can be applied to all mappings, and only checked it at runtime. touched checker
changed from list of names to a function of(name, data) => true|false
, which accepts current field name and data map, and return true if touched, and false if not touched.FormBinder
not hold constraints/pre-processors any more. Let's attach them to related mapping definitions if necessary.
!!!WRANING: some broken changes were introduced. But I don't want to list the details here, since they are not big changes, and you can find and fix it easily when upgrading.
v0.9.0
- code refactoring and doc enhancement
- change
FormBinder.bind
(!!!WARNING: broken change for normal developers),
from
// bind mappings to data,
// consume it directly and return result, if validation passed;
// return (processed) errors, if validation failed
def bind[T, R2, M <: InputMode](mapping: Mapping[T, M], data: Map[String, String])(consume: T => R2)
to
// bind mappings to data, and return an either, holding validation errors (left) or converted value (right);
// let user to decide how to proceed
def bind[T, M <: InputMode](mapping: Mapping[T, M], data: Map[String, String]): Either[R, T]
v0.8.0
- change interface
Constraint
to(name, data, messages, options) => errors
, and now it can be applied to both mappings andFormBinder
(!!!WARNING: broken change for extension developers) - merge/change interfaces
PreProcessor
/BulkPrePrecessor
to(prefix, data, options) => data
, and now it can be applied to bothFormBinder
and mappings (!!!WARNING: broken change for extension developers) - rename
pipe_:
to>-:
(!!!WARNING: broken change for normal developers) - change pre-processor
expandJsonData(sourceKey[, destPrefix])
toexpandJsonString([sourceKey][, destPrefix])
, and now it can be applied to all mappings andFormBinder
(!!!WARNING: broken change for normal developers) - add constraint
numArrayIndex
, used to validate illegal array index, likeaaa[t123]
- enhance constraint
required
, and now it can be applied to both field mappings and group mappings - add built-in field mapping
json4s
- add
InputMode
to help restrict aConstraint
/PreProcessor
can accept one input string or multiple input strings or both (for extension developers)