Convert string boolean to boolean type

Imagine a request like this : /resources?valid=true
When you retrieve valid parameter from query its type is string and not boolean. So if you want criteria matching base on boolean you must send /resources?valid=1. I think it's not the beautiful way to do it.