We need to coerce boolean values so they are converted to JSON boolean values by JSON::Validator instead of just passing the '1' and '0' strings. Steps to reproduce: - Have a patron with 'Lost card' set to 'Yes'. - Open your favourite REST testing tool (HttpRequester on Firefox for example) - Point it to http://localhost:8081/api/v1/patrons/16 (assuming your borrowernumber is 16) => FAIL: You get an error mentioning a Boolean is expected and got a String value.
Adding a TO_JSON method seems a better approach as it won't hide data issues (which could happen if coercing values into booleans). *** This bug has been marked as a duplicate of bug 17932 ***