playframework/Play20 — pull request #510 by ottovw (2012-11-01 19:56:28+00:00)
Title: Optional form mapping: added flag to respect empty values

Added a flag to the optional mapping which allows to change the mapping's behavior concerning empty values.

If the flag ist set "someField" -> "" is mapped to Some("") instead of None.

For BC the flag ist set to false by default:

def optional[A](mapping: Mapping[A], respectEmptyValues: Boolean = false)

Test cases are included in the patch.