Bug 17445: Add 'malformed query' error response
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 14 Oct 2016 08:57:30 +0000 (08:57 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Oct 2016 17:15:24 +0000 (17:15 +0000)
commit4cbbe58ad04f515a39e2cd5e5ed5d92e4388da49
tree4c6d13a17294b3770e6f0025030fc804ecac8a82
parent947ab63bb761cf2948d80ba590566114a2e48c32
Bug 17445: Add 'malformed query' error response

This patch adds to the x-mojo-around action code to give a meaningful
error given a bad query parameter in the query string for a request.

Test Plan
1) Submit an api request to an existing restful endpoint with no query
parameters
2) Confirm the correct response is being given
3) Submit an api request to an existing restful endpoint with an allowed
query parameter
4) Confimr the correct response is being given
5) Submit an api request to an existing restful endpoint with a
malformed query paramter
6) Note the 400 response code and helpful json api body

https://bugs.koha-community.org/show_bug.cgi?id=17445

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1.pm