Koha/api/v1/swagger/definitions/desk.yaml
Tomas Cohen Arazi afd83c134e
Bug 36480: Add GET /libraries/:library_id/desks
This patch adds the mentioned endpoint. For it, it does:

* Add Koha::Desk->to_api_mapping
* Add desk.yaml with the correct data structure for desks
* Add the route to the spec
* Add tests

Note: Lucas and I had doubts about the right return value for when the feature is disabled.
I opted for returning 404 with a message telling the feature is disabled. This can be discussed.

To test:
1. Apply this patches
2. Run:
   $ ktd
  k$ qa
=> SUCCESS: All green, all tests pass!
3. Play with this using Postman.
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 18:06:10 +02:00

19 lines
360 B
YAML

---
type: object
properties:
desk_id:
type: integer
description: Internal desk identifier
name:
type: string
description: The desk display name
library_id:
type: string
description: Internally assigned library identifier
maxLength: 10
minLength: 1
additionalProperties: false
required:
- desk_id
- name
- library_id