]> 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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 1 Nov 2023 20:23:14 +0000 (17:23 -0300)
commit82bdf93ab71f4d16ced622667ef89bafb5008d1e
treea748b7f4cd15553f4ac25c9d0e1bbcec906ec84f
parent29bf7500f9c24e7875865b502b7a6b088fc0983b
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>
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]