redstone-dart / redstone

A metadata driven microframework for Dart.
http://redstone-dart.github.io/redstone
MIT License
342 stars 42 forks source link

bool QueryParam not being parsed as a boolean on v0.6 #133

Closed cgarciae closed 9 years ago

cgarciae commented 9 years ago

This simple examples

testQueryParams (@app.QueryParam() bool check) => !check;

gives rise to

type 'String' is not a subtype of type 'bool' of 'check'

meaning that is being passed as a String instead of a bool.

luizmineo commented 9 years ago

See ParametersProcessos.getValueConverter() method. I think you can just change the last condifition to:

if (paramType == boolType) {
  return (String value) => "true" == value.toLowerCase();
}
cgarciae commented 9 years ago

Thanks @luizmineo ! Code fixed and available on pub :)