]> git.koha-community.org Git - koha.git/commit
Bug 37018: Add 400 response definition to all routes
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 8 Jul 2024 20:21:25 +0000 (17:21 -0300)
committerwainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
Tue, 23 Jul 2024 04:42:52 +0000 (04:42 +0000)
commitbb09e474a05567e391860c8253084538a4b47a85
treead58d587d3e2b4f65af9dbaed2cc06e9b4d0223d
parent534e7bf44a3667046793c07a9f17a4bcc13a3b74
Bug 37018: Add 400 response definition to all routes

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: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
51 files changed:
Koha/REST/Plugin/Exceptions.pm
api/v1/swagger/paths/acquisitions_baskets.yaml
api/v1/swagger/paths/acquisitions_funds.yaml
api/v1/swagger/paths/acquisitions_orders.yaml
api/v1/swagger/paths/acquisitions_vendors.yaml
api/v1/swagger/paths/advancededitormacros.yaml
api/v1/swagger/paths/auth.yaml
api/v1/swagger/paths/authorised_value_categories.yaml
api/v1/swagger/paths/authorised_values.yaml
api/v1/swagger/paths/authorities.yaml
api/v1/swagger/paths/biblios.yaml
api/v1/swagger/paths/biblios_item_groups.yaml
api/v1/swagger/paths/cash_registers.yaml
api/v1/swagger/paths/checkouts.yaml
api/v1/swagger/paths/circulation-rules.yaml
api/v1/swagger/paths/cities.yaml
api/v1/swagger/paths/clubs.yaml
api/v1/swagger/paths/config_smtp_servers.yaml
api/v1/swagger/paths/erm_agreements.yaml
api/v1/swagger/paths/erm_config.yaml
api/v1/swagger/paths/erm_documents.yaml
api/v1/swagger/paths/erm_eholdings_packages.yaml
api/v1/swagger/paths/erm_eholdings_packages_resources.yaml
api/v1/swagger/paths/erm_eholdings_resources.yaml
api/v1/swagger/paths/erm_eholdings_titles.yaml
api/v1/swagger/paths/erm_eholdings_titles_resources.yaml
api/v1/swagger/paths/erm_licenses.yaml
api/v1/swagger/paths/erm_users.yaml
api/v1/swagger/paths/holds.yaml
api/v1/swagger/paths/ill_backends.yaml
api/v1/swagger/paths/ill_requests.yaml
api/v1/swagger/paths/import_batch_profiles.yaml
api/v1/swagger/paths/import_batches.yaml
api/v1/swagger/paths/item_types.yaml
api/v1/swagger/paths/items.yaml
api/v1/swagger/paths/jobs.yaml
api/v1/swagger/paths/libraries.yaml
api/v1/swagger/paths/oauth.yaml
api/v1/swagger/paths/patrons.yaml
api/v1/swagger/paths/patrons_account.yaml
api/v1/swagger/paths/patrons_extended_attributes.yaml
api/v1/swagger/paths/patrons_holds.yaml
api/v1/swagger/paths/public_oauth.yaml
api/v1/swagger/paths/quotes.yaml
api/v1/swagger/paths/rotas.yaml
api/v1/swagger/paths/search_filters.yaml
api/v1/swagger/paths/suggestions.yaml
api/v1/swagger/paths/tickets.yaml
api/v1/swagger/paths/transfer_limits.yaml
t/db_dependent/api/v1/query.t
xt/api.t