Releases: tminglei/form-binder
Releases · tminglei/form-binder
v0.12.2
v0.12.1
v0.12.0
Refactoring:
- move misc interfaces/classes from
Frameworkto package file - intelligently detect label key and remove
i18noption (p.s. labels starting with@will be used as message key) - rename option items
ignoreEmpty/touchedtoskipUntouched/touchedChecker(!!! broken changes)
v0.11.0
v0.10.1
v0.10.0
Code refactor inspired by form-binder-java:
- remove
InputModeas type parameter ofMapping/Constraint/PreProcessors. Currently all constraints/pre-processors can be applied to all mappings, and only checked it at runtime. touched checkerchanged 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.FormBindernot 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
Constraintto(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/BulkPrePrecessorto(prefix, data, options) => data, and now it can be applied to bothFormBinderand 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
InputModeto help restrict aConstraint/PreProcessorcan accept one input string or multiple input strings or both (for extension developers)