]> git.koha-community.org Git - koha.git/commit
Bug 34008: Add REST endpoint for list of itemtypes
authorAndreas Jonsson <andreas.jonsson@kreablo.se>
Sat, 16 Sep 2023 10:13:15 +0000 (10:13 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 8 Nov 2023 08:41:49 +0000 (22:41 -1000)
commit02ad2a271d7982ed434a6780eef1ba83ff497215
tree0c4f8d35301c961701adb3f72ff0564732076dd7
parentf50f5a1dccef4de31e1148232bacdf435f8bd156
Bug 34008: Add REST endpoint for list of itemtypes

Test plan:
* Enable the system preference RESTBasicAuth
* curl -s --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should give 401 Unauthorized
* curl -s -u koha:koha --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should produce JSON-list of itemtypes
* curl -s -u koha:koha --header "x-koha-embed: translated_descriptions" --request GET http://kohadev-intra.mydnsname.org:8081/api/v1/itemtypes
  should include the field translated_descriptions containing the translated descriptions, if any

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] perltidy -b t/db_dependent/api/v1/itemtypes.t # Resolve bad score of 44
[EDIT] chmod 755 t/db_dependent/api/v1/itemtypes.t
[EDIT] perltidy -b Koha/REST/V1/ItemTypes.pm
Lesson: Please run qa tools yourself and adjust accordingly?
Edit (tcohen): I restored the item_type_translated_description.yaml file
as the entire API was broken because of the lack of it.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdf93ab71f4d16ced622667ef89bafb5008d1e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/ItemType.pm
Koha/REST/V1/ItemTypes.pm [new file with mode: 0644]
api/v1/swagger/definitions/item_type.yaml [new file with mode: 0644]
api/v1/swagger/definitions/item_type_translated_description.yaml [new file with mode: 0644]
api/v1/swagger/paths/item_types.yaml [new file with mode: 0644]
api/v1/swagger/swagger.yaml
t/db_dependent/api/v1/item_types.t [new file with mode: 0755]