Koha/api/v1/swagger/paths/clubs.yaml
Martin Renvoize 9e50bcc1b5 Bug 30194: (follow-up) Simply OpenAPI Specification
This patch simplifies the specification directory further by doing the
following:

* Inlines paths.yml into swagger.yaml
* Inlines definitions.yaml into swagger.yaml
* Inlines parameters.yaml into swagger.yaml
* Drops x-primitives.yaml

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-29 16:44:31 +02:00

96 lines
2.8 KiB
YAML

---
"/clubs/{club_id}/holds":
post:
x-mojo-to: Clubs::Holds#add
operationId: addClubHold
tags:
- clubs
summary: Add a club hold
parameters:
- $ref: "../swagger.yaml#/parameters/club_id_pp"
- name: body
in: body
description: A JSON object containing informations about the new hold
required: true
schema:
type: object
properties:
biblio_id:
description: Internal biblio identifier
type:
- integer
- "null"
item_id:
description: Internal item identifier
type:
- integer
- "null"
pickup_library_id:
description: Internal library identifier for the pickup library
type: string
expiration_date:
description: Hold end date
type:
- string
- "null"
format: date
notes:
description: Notes related to this hold
type:
- string
- "null"
item_type:
description: Limit hold on one itemtype (ignored for item-level holds)
type:
- string
- "null"
default_patron_home:
description: For each patron, set pickup location to patron's home library if
possible
type: integer
required:
- pickup_library_id
additionalProperties: false
consumes:
- application/json
produces:
- application/json
responses:
"201":
description: Created club hold
schema:
$ref: "../definitions/club_hold.yaml"
"400":
description: Missing or wrong parameters
schema:
$ref: "../swagger.yaml#/definitions/error"
"401":
description: Authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
"403":
description: Hold not allowed
schema:
$ref: "../swagger.yaml#/definitions/error"
"404":
description: Club not found
schema:
$ref: "../swagger.yaml#/definitions/error"
"409":
description: Hold not allowed
schema:
$ref: "../swagger.yaml#/definitions/error"
"500":
description: |
Internal server error. Possible `error_code` attribute values:
* `internal_server_error`
schema:
$ref: "../swagger.yaml#/definitions/error"
"503":
description: Under maintenance
schema:
$ref: "../swagger.yaml#/definitions/error"
x-koha-authorization:
permissions:
reserveforothers: "1"