From b5dbac60405b64bdcb509246aad46bd45e125346 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 21 Oct 2024 14:42:47 -0300 Subject: [PATCH] Bug 34784: API spec Signed-off-by: Tomas Cohen Arazi --- api/v1/swagger/paths/rpc_biblios.yaml | 140 ++++++++++++++++++++++++++ api/v1/swagger/swagger.yaml | 4 + 2 files changed, 144 insertions(+) create mode 100644 api/v1/swagger/paths/rpc_biblios.yaml diff --git a/api/v1/swagger/paths/rpc_biblios.yaml b/api/v1/swagger/paths/rpc_biblios.yaml new file mode 100644 index 00000000000..06ad9559aeb --- /dev/null +++ b/api/v1/swagger/paths/rpc_biblios.yaml @@ -0,0 +1,140 @@ +--- +"/rpc/biblios/{biblio_id}/items/populate_empty_callnumbers": + post: + x-mojo-to: RPC::Biblios#populate_empty_callnumbers + operationId: RPCBiblioPopulateEmptyItemsCallnumbers + tags: + - biblios + summary: Populate empty item callnumbers from biblio callnumber for all items on record with no callnumber + parameters: + - $ref: "../swagger.yaml#/parameters/biblio_id_pp" + produces: + - application/json + responses: + "200": + description: Callnumbers updated + schema: + type: object + properties: + updated_items_count: + description: Number of items updated + type: integer + callnumber: + description: Callnumber added to updated items + type: string + modified_item_ids: + description: A list of item IDs for the actually modified items + type: array + items: + type: integer + description: Internal item identifier for the modified item + required: + - updated_items_count + - callnumber + additionalProperties: false + "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" + "404": + description: Not found + schema: + $ref: "../swagger.yaml#/definitions/error" + "409": + description: | + Conflict. Possible `error_code` attribute values: + + * `missing_configuration` + * `callnumber_empty` + "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: + editcatalogue: edit_catalogue +"/rpc/biblios/{biblio_id}/items/{item_id}/populate_empty_callnumbers": + post: + x-mojo-to: RPC::Biblios#populate_empty_callnumbers + operationId: RPCBiblioPopulateEmptyItemCallnumber + tags: + - biblios + summary: Populate empty item callnumbers from biblio callnumber for all items on record with no callnumber + parameters: + - $ref: "../swagger.yaml#/parameters/biblio_id_pp" + - $ref: "../swagger.yaml#/parameters/item_id_pp" + produces: + - application/json + responses: + "200": + description: Callnumbers updated + schema: + type: object + properties: + updated_items_count: + description: Number of items updated + type: integer + callnumber: + description: Callnumber added to updated items + type: string + modified_item_ids: + description: A list of item IDs for the actually modified items + type: array + items: + type: integer + description: Internal item identifier for the modified item + required: + - updated_items_count + - callnumber + additionalProperties: false + "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" + "404": + description: Not found + schema: + $ref: "../swagger.yaml#/definitions/error" + "409": + description: | + Conflict. Possible `error_code` attribute values: + + * `missing_configuration` + * `callnumber_empty` + "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: + editcatalogue: edit_catalogue diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index dd72361380e..f25f90cfae9 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -541,6 +541,10 @@ paths: $ref: "./paths/rotas.yaml#/~1rotas~1{rota_id}" "/rotas/{rota_id}/stages/{stage_id}/position": $ref: "./paths/rotas.yaml#/~1rotas~1{rota_id}~1stages~1{stage_id}~1position" + "/rpc/biblios/{biblio_id}/items/{item_id}/populate_empty_callnumbers": + $ref: "./paths/rpc_biblios.yaml#/~1rpc~1biblios~1{biblio_id}~1items~1{item_id}~1populate_empty_callnumbers" + "/rpc/biblios/{biblio_id}/items/populate_empty_callnumbers": + $ref: "./paths/rpc_biblios.yaml#/~1rpc~1biblios~1{biblio_id}~1items~1populate_empty_callnumbers" /suggestions: $ref: ./paths/suggestions.yaml#/~1suggestions "/suggestions/{suggestion_id}": -- 2.47.0