Tomas Cohen Arazi
35e9ac9b0a
This patch adds a test for well defined 400 responses on all verbs and paths on the API spec. The tests verify: * Presence of 400 response definition * The description must start with 'Bad request' (needs coding guideline) * If DBIC queries are allowed on the route, then `invalid_query` needs to be mentioned in the description. All routes get fixed to make the tests pass. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ yarn api:bundle k$ prove xt/api.t => SUCCESS: Tests pass! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
184 lines
5.4 KiB
YAML
184 lines
5.4 KiB
YAML
---
|
|
"/erm/counter_files/{erm_counter_files_id}/file/content":
|
|
get:
|
|
x-mojo-to: ERM::EUsage::CounterFiles#get
|
|
operationId: downloadCounterFile
|
|
tags:
|
|
- erm_counter_files
|
|
summary: Download Counter file
|
|
produces:
|
|
- application/octet-stream
|
|
parameters:
|
|
- description: Case insensitive search on erm_counter_files_id
|
|
in: path
|
|
name: erm_counter_files_id
|
|
required: true
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: A counter file
|
|
schema:
|
|
type: file
|
|
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: Ressource 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:
|
|
erm: 1
|
|
/erm/counter_files:
|
|
get:
|
|
x-mojo-to: ERM::EUsage::CounterFiles#list
|
|
operationId: listErmCounterFiles
|
|
tags:
|
|
- erm_counter_files
|
|
summary: List counter_files
|
|
produces:
|
|
- application/json
|
|
parameters:
|
|
- description: Case insensitive search on counter_file erm_counter_files_id
|
|
in: query
|
|
name: erm_counter_files_id
|
|
required: false
|
|
type: integer
|
|
- description: Case insensitive search on counter_file usage_data_provider_id
|
|
in: query
|
|
name: usage_data_provider_id
|
|
required: false
|
|
type: integer
|
|
- description: Case insensitive search on counter_file filename
|
|
in: query
|
|
name: filename
|
|
required: false
|
|
type: string
|
|
- description: Case insensitive search on counter_file type
|
|
in: query
|
|
name: type
|
|
required: false
|
|
type: string
|
|
- description: Case insensitive search on counter_file file_content
|
|
in: query
|
|
name: file_content
|
|
required: false
|
|
type: string
|
|
- description: Case insensitive search on counter_file date_uploaded
|
|
in: query
|
|
name: date_uploaded
|
|
required: false
|
|
type: string
|
|
- name: x-koha-embed
|
|
in: header
|
|
required: false
|
|
description: Embed list sent as a request header
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- counter_logs
|
|
collectionFormat: csv
|
|
- $ref: "../swagger.yaml#/parameters/match"
|
|
- $ref: "../swagger.yaml#/parameters/order_by"
|
|
- $ref: "../swagger.yaml#/parameters/page"
|
|
- $ref: "../swagger.yaml#/parameters/per_page"
|
|
- $ref: "../swagger.yaml#/parameters/q_param"
|
|
- $ref: "../swagger.yaml#/parameters/q_body"
|
|
responses:
|
|
200:
|
|
description: A list of counter_files
|
|
schema:
|
|
items:
|
|
$ref: "../swagger.yaml#/definitions/erm_counter_file"
|
|
type: array
|
|
400:
|
|
description: |
|
|
Bad request. Possible `error_code` attribute values:
|
|
|
|
* `invalid_query`
|
|
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:
|
|
erm: 1
|
|
"/erm/counter_files/{erm_counter_files_id}":
|
|
delete:
|
|
x-mojo-to: ERM::EUsage::CounterFiles#delete
|
|
operationId: deleteERMCounterFiles
|
|
tags:
|
|
- erm_counter_files
|
|
summary: Delete counter_file
|
|
produces:
|
|
- application/json
|
|
parameters:
|
|
- $ref: "../swagger.yaml#/parameters/erm_counter_files_id_pp"
|
|
responses:
|
|
204:
|
|
description: counter_file deleted
|
|
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: ressource not found
|
|
schema:
|
|
$ref: "../swagger.yaml#/definitions/error"
|
|
409:
|
|
description: conflict in deleting resource
|
|
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:
|
|
erm: 1
|