]> git.koha-community.org Git - koha.git/commit
Bug 17428: [REST] best practice followup
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 12 Oct 2016 21:31:30 +0000 (21:31 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Oct 2016 14:42:49 +0000 (14:42 +0000)
commite08639129aec34d2228e08e65a0ef8ba008c6efc
treede6a06b5d95772f83f1a53cb2088b042e1e90a04
parent29ba2720043b493fc96ed4238a4f2a3a76b9192c
Bug 17428: [REST] best practice followup

This followup alters a few area's to be aligned more closely with
RESTfull best practices:

* PUT should always be full objects, and not partial updates (use PATCH
  for partials)
* Validate query parameters instead of blindly passing them to the model
  * Functional Change: Convert filter params from 'equality' to 'starts with'
    matching
* Update tests to check for swagger validation errors instead of koha exceptions
* Mark 'id' as readOnly so swagger may prevent, via validation, id
  changes.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1/Cities.pm
api/v1/swagger/definitions/city.json
api/v1/swagger/paths/cities.json
api/v1/swagger/x-primitives.json
t/db_dependent/api/v1/cities.t