Skip to content

Releases: tminglei/form-binder

v0.12.2

08 Apr 15:42
Compare
Choose a tag to compare

Refactoring:

  1. rename method mapTo of Mapping[T] to map (!!! broken changes)
  2. more graceful attachment way, check here for sample codes.

p.s. method $ext(..) in Mapping[T] was removed (!!! broken changes).

v0.12.1

03 Mar 04:09
Compare
Choose a tag to compare
  1. remove unnecessary scala-reflect dependency
  2. change json parser from json4s to spray-json, to reduce nested dependencies

v0.12.0

27 Feb 11:32
Compare
Choose a tag to compare

Refactoring:

  1. move misc interfaces/classes from Framework to package file
  2. intelligently detect label key and remove i18n option (p.s. labels starting with @ will be used as message key)
  3. rename option itemsignoreEmpty/touched to skipUntouched/touchedChecker (!!! broken changes)

v0.11.0

21 Feb 02:21
Compare
Choose a tag to compare
  1. add meta support
  2. add ext info support

v0.10.1

02 Aug 09:25
Compare
Choose a tag to compare
  1. added a helper method to simple, which can convert request.getParemeterMap (Map[String, String[]]) to data (Map[String, String]) directly.
  2. some minor bug fix, code refactor and enhancement

v0.10.0

19 Jul 07:05
Compare
Choose a tag to compare

Code refactor inspired by form-binder-java:

  • remove InputMode as type parameter of Mapping/Constraint/PreProcessors. 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

12 Apr 23:27
Compare
Choose a tag to compare
  1. code refactoring and doc enhancement
  2. 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

02 Nov 22:49
Compare
Choose a tag to compare
  1. change interface Constraint to (name, data, messages, options) => errors, and now it can be applied to both mappings and FormBinder (!!!WARNING: broken change for extension developers)
  2. merge/change interfaces PreProcessor/BulkPrePrecessor to (prefix, data, options) => data, and now it can be applied to both FormBinder and mappings (!!!WARNING: broken change for extension developers)
  3. rename pipe_: to >-: (!!!WARNING: broken change for normal developers)
  4. change pre-processor expandJsonData(sourceKey[, destPrefix]) to expandJsonString([sourceKey][, destPrefix]), and now it can be applied to all mappings and FormBinder (!!!WARNING: broken change for normal developers)
  5. add constraint numArrayIndex, used to validate illegal array index, like aaa[t123]
  6. enhance constraint required, and now it can be applied to both field mappings and group mappings
  7. add built-in field mapping json4s
  8. add InputMode to help restrict a Constraint/PreProcessor can accept one input string or multiple input strings or both (for extension developers)

v0.6.0

18 Oct 22:43
Compare
Choose a tag to compare
  1. change interface Messages to (String) => Option[String] (!!!WARNING: broken change)
  2. add i18n option support, so label can be used as a key to fetch an i18n value now
  3. add built-in uuid (java.util.UUID) field mapping

v0.5.0

09 Oct 05:58
Compare
Choose a tag to compare
  1. add options support
  2. enhance validating with option eagerCheck/ignoreEmpty and touched list
  3. add validate method in FormBinder