mitchellh/mapstructure — pull request #5 by gyim (2013-08-04 20:44:22+00:00)
Title: Add support for more advanced type conversions

When you communicate with a weakly typed language such as PHP, you can never be sure whether you will receive your input as a bool, a number, or a string. This patch adds support for these automatic type conversions:

- numbers (ints, floats) <-> strings
- bools <-> numbers and strings
- empty maps <-> empty arrays/slices (a PHP `array()` can either be a `{}` or a `[]`)

These type conversions are optional: it can be enabled by setting the `WeaklyTypedInput` flag in `DecoderConfig`.