Koha/api/v1/swagger/paths/circulation_rules.yaml
Martin Renvoize a0f7c4c33b
Bug 36641: (follow-up) Ensure limited return works
We have a ?rules=a,b parameter available for specifying a subset of
rules in the set to return. This patch adds a test to confirm that works
(and fixes the controller and specification as the test proved it wasn't
working)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-07-18 18:25:49 +02:00

103 lines
3 KiB
YAML

---
/circulation_rules:
get:
x-mojo-to: CirculationRules#list_rules
operationId: listCirculationRules
tags:
- circulation_rules
summary: Get circulation rules for a given item type/library/patron combination.
produces:
- application/json
parameters:
- name: effective
in: query
description: Boolean indicating whether to return effective rules or all rules. Defaults to true.
required: false
type: boolean
- name: item_type_id
in: query
description: The item type identifier
required: false
type: string
- name: library_id
in: query
description: The library identifier
required: false
type: string
- name: patron_category_id
in: query
description: The patron category identifier
required: false
type: string
- name: rules
in: query
description: A comma-separated list of rule kinds
required: false
type: string
responses:
"200":
description: A list of rules for this item type, library and patron category combination
schema:
type: array
items:
type: object
"400":
description: Bad request
schema:
$ref: "../swagger.yaml#/definitions/error"
"401":
description: Authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
"403":
description: Access forbidden
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:
- circulate: circulate_remaining_permissions
/circulation_rules/kinds:
get:
x-mojo-to: CirculationRules#get_kinds
operationId: getCirculationRuleKinds
tags:
- circulation_rules
summary: Get circulation rules kinds
produces:
- application/json
responses:
"200":
description: A map of rule kind information
schema:
type: object
additionalProperties:
$ref: "../swagger.yaml#/definitions/circ-rule-kind"
"403":
description: Access forbidden
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:
- circulate: circulate_remaining_permissions