bluefeet / GitLab-API-v4

A complete GitLab API v4 client.
https://metacpan.org/pod/GitLab::API::v4
Other
20 stars 22 forks source link

Errors on Gitlab API returning invalid JSON #12

Closed royce55 closed 6 years ago

royce55 commented 6 years ago

Gitlab API doesn't always return valid JSON. For example block_user & unblock_user just return strings 'true' or 'false' this causes Serializer to fall over with a error as below

Data was $VAR1 = [ 'true' ]; at /usr/lib/perl5/vendor_perl/5.26.0/Role/REST/Client/Serializer.pm line 80. Couldn't deserialize data with application/json: JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/pkg/lib/perl5/vendor_perl/5.26.0/Data/Serializer/JSON.pm line 17.

Thanks for the API Royce

bluefeet commented 6 years ago

Fixed by #13. :)