Koha/api/v1/swagger
Tomas Cohen Arazi 694c09aa87 Bug 18409: Make the controller for holds use Koha::Holds
Recently, there's been a major fix on the REST api swagger spec,
which involved fixing boolean values so they are actually booleans
and Koha::Object was extended to handle that.
While the swagger spec for this endpoint got fixed, such is not the case
with the implementation (the controller class).

This patch fixes this situation by:
- Specifying boolean properties as boolean in the schema file
- Fixes the controller so it returns Koha::Hold objects instead of the
  hashref returned by GetReserve, which is wrong.
- Better (than empty) descriptions are added to 'suspend',
  'suspend_until' and 'lowestPriority' on the spec.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, mostly due to error 500 results.
- Apply this patch
- Run:
 k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!
- Sign off :-D

This can also be tested using any interface for REST apis.

Note: This endpoint lacks several of the new guidelines and is not
complete (there's no GET for single holds, etc). It is also missing
exception handling. There are probably
other bug reports for that, just thought it was worth mentioning.

Followed test plan and this patch worked as intended
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-04-24 09:40:40 -04:00
..
definitions Bug 18409: Make the controller for holds use Koha::Holds 2017-04-24 09:40:40 -04:00
parameters Bug 17428: [REST] Cities swagger specification 2016-10-28 14:42:48 +00:00
paths Bug 17086: Reword borrowers to patrons in Swagger tags for holds 2016-11-22 11:31:08 +00:00
definitions.json Bug 17428: [REST] Cities swagger specification 2016-10-28 14:42:48 +00:00
parameters.json Bug 17428: [REST] Cities swagger specification 2016-10-28 14:42:48 +00:00
paths.json Bug 17428: [REST] Cities swagger specification 2016-10-28 14:42:48 +00:00
swagger.json Bug 17428: (QA followup) Fix community site in swagger file 2016-10-28 14:42:50 +00:00
x-primitives.json Bug 17927: (followup) Fix /cities cityid type 2017-02-07 17:55:43 +00:00