Koha/api/v1/swagger/paths/import_batches.yaml
Tomas Cohen Arazi 891972d0d3
Bug 30855: Rename /import => /import_batches
This patch renames the route to make it consistent for future additions.

To test:
1. Run
   $ git grep 'matches/chosen'
=> FAIL: all occurences use /api/v1/import/
2. Apply this patch
3. Run:
   $ git grep 'matches/chosen'
=> SUCCESS: All occurences have '/api/v1/import_batches/'
4. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/import_record_matches.t
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-06-02 13:42:28 -03:00

115 lines
3.2 KiB
YAML

---
"/import_batches/{import_batch_id}/records/{import_record_id}/matches/chosen":
put:
x-mojo-to: ImportRecordMatches#set_chosen
operationId: setChosen
summary: Set the chosen match for an import record ID
tags:
- import_batches
parameters:
- name: import_batch_id
in: path
required: true
description: An import_batch ID
type: integer
- name: import_record_id
in: path
required: true
description: An import_record ID
type: integer
- name: body
in: body
description: A JSON object containing fields to modify
required: true
schema:
type: object
properties:
candidate_match_id:
description: Candidate match to choose
type: integer
additionalProperties: false
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: Match updated
"400":
description: Missing or wrong parameters
schema:
$ref: "../swagger.yaml#/definitions/error"
"401":
description: Authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
"403":
description: Match management not allowed
schema:
$ref: "../swagger.yaml#/definitions/error"
"404":
description: Import record match not found
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:
tools: manage_staged_marc
delete:
x-mojo-to: ImportRecordMatches#unset_chosen
operationId: unsetChosen
summary: Unset the chosen match for an import record ID
tags:
- import_batches
parameters:
- name: import_batch_id
in: path
required: true
description: An import_batch ID
type: integer
- name: import_record_id
in: path
required: true
description: An import_record ID
type: integer
produces:
- application/json
responses:
"204":
description: Matches unchosen
"401":
description: Authentication required
schema:
$ref: "../swagger.yaml#/definitions/error"
"403":
description: Match management not allowed
schema:
$ref: "../swagger.yaml#/definitions/error"
"404":
description: Import record matches not found
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:
tools: manage_staged_marc