]> 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)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 25 Jul 2024 15:10:22 +0000 (15:10 +0000)
commitb4e3a0aaeab39f5ee329ec209dada7a9d41b857b
tree11068b725da1ab6ffd27a785f29029d6d8640300
parente7b3d05bc740b459d0c700545c8c280a14fe72ad
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: Lucas Gass <lucas@bywatersolutions.com>
76 files changed:
Koha/REST/Plugin/Exceptions.pm
api/v1/swagger/paths/acquisitions_baskets.yaml
api/v1/swagger/paths/acquisitions_edifiles.yaml
api/v1/swagger/paths/acquisitions_funds.yaml
api/v1/swagger/paths/acquisitions_orders.yaml
api/v1/swagger/paths/acquisitions_vendor_issues.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/biblios_merge.yaml
api/v1/swagger/paths/bookings.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/deleted_biblios.yaml
api/v1/swagger/paths/erm_agreements.yaml
api/v1/swagger/paths/erm_counter_files.yaml
api/v1/swagger/paths/erm_counter_logs.yaml
api/v1/swagger/paths/erm_counter_registries.yaml
api/v1/swagger/paths/erm_custom_reports.yaml
api/v1/swagger/paths/erm_default_usage_reports.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_sushi_services.yaml
api/v1/swagger/paths/erm_usage_data_providers.yaml
api/v1/swagger/paths/erm_usage_databases.yaml
api/v1/swagger/paths/erm_usage_items.yaml
api/v1/swagger/paths/erm_usage_platforms.yaml
api/v1/swagger/paths/erm_usage_titles.yaml
api/v1/swagger/paths/erm_users.yaml
api/v1/swagger/paths/extended_attribute_types.yaml [new file with mode: 0644]
api/v1/swagger/paths/holds.yaml
api/v1/swagger/paths/ill_backends.yaml
api/v1/swagger/paths/ill_batches.yaml
api/v1/swagger/paths/ill_batchstatuses.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/patron_categories.yaml
api/v1/swagger/paths/patrons.yaml
api/v1/swagger/paths/patrons_account.yaml
api/v1/swagger/paths/patrons_checkouts.yaml
api/v1/swagger/paths/patrons_extended_attributes.yaml
api/v1/swagger/paths/patrons_holds.yaml
api/v1/swagger/paths/patrons_recalls.yaml
api/v1/swagger/paths/preservation_processings.yaml
api/v1/swagger/paths/preservation_trains.yaml
api/v1/swagger/paths/preservation_waiting_list.yaml
api/v1/swagger/paths/public_oauth.yaml
api/v1/swagger/paths/public_patrons.yaml
api/v1/swagger/paths/quotes.yaml
api/v1/swagger/paths/record_sources.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