Koha-clms/api/v1/swagger/definitions
Lari Taskula c42848609c
Bug 38365: Make swagger-cli happy
Schema type [array,object] is not valid in OpenAPI version 2.

There are two different CSP reporting directives.

One is the now deprecated "report-uri" directive. Browsers typically send a single
JSON object following the CSP2 specification.

"report-uri" is deprecated in CSP3 in favor of the newer "report-to" directive. It
is expected to contain an array of report objects.

There are browser that do not yet support the "report-to" directive, so both
directives should be supported.

There are also variations among the "report-uri" format. See
https://www.tollmanz.com/content-security-policy-report-samples/

Because of these variations, it becomes quite complex to handle the most common
cases in a single API endpoint.

We could build two separate endpoints for both directives.

Or we can accept any type of input and handle the variations in a single endpoint.
This patch attempts to do that.

Before this patch input parameters were validated by JSON::Validator. That is the
normal and recommended way to build OpenAPI endpoints in Koha. After this patch we
remove all input parameter restrictions from the OpenAPI spec, and simply accept
any type of body.

This means the controller will now always return a HTTP 204 regardless of the type
of data passed to the controller. It instead truncates too long input before
writing them into log files.

As this is not an endpoint that developers will build new Koha clients for, we
do not have to offer a very in-depth input parameter spec for this endpoint.

To test:
1. t/db_dependent/api/v1/public/csp_reports.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2026-03-16 11:57:37 +01:00
..
account_line.yaml Bug 22421: (QA follow-up) Update API mapping and specs 2024-11-08 17:06:06 +01:00
additional_content.yaml Bug 39900: Add translated_contents embed 2025-08-14 16:05:54 -06:00
advancededitormacro.yaml
…
allows_renewal.yaml
…
authorised_value.yaml
…
authorised_value_category.yaml
…
basket.yaml Bug 29668: Add API route to add a basket 2026-01-21 15:28:09 -07:00
booking.yaml Bug 40134: Implement optimal item selection for 'any item' bookings 2026-02-10 08:50:56 -07:00
booking_patch.yaml Bug 40134: Implement optimal item selection for 'any item' bookings 2026-02-10 08:50:56 -07:00
bundle_link.yaml
…
cash_register.yaml
…
cashup.yaml
…
checkout.yaml Bug 41700: Update note_date to datetime 2026-01-28 14:24:05 -07:00
checkout_availability.yaml
…
checkouts.yaml
…
circ-rule-kind.yaml
…
circulation_rules.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
city.yaml
…
club_hold.yaml
…
club_hold_patron_hold.yaml
…
club_hold_patron_holds.yaml
…
club_holds.yaml
…
credit.yaml
…
debit.yaml Bug 22421: (QA follow-up) Update API mapping and specs 2024-11-08 17:06:06 +01:00
desk.yaml
…
edifact_file.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_agreement.yaml Bug 40512: Add maxLength to erm agreements 2025-10-02 09:38:18 -06:00
erm_agreement_license.yaml
…
erm_agreement_period.yaml Bug 39438: Add additional fields support to ERM agreement periods 2026-01-30 10:54:10 -07:00
erm_agreement_relationship.yaml
…
erm_config.yaml
…
erm_counter_file.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_counter_log.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_counter_registry.yaml
…
erm_custom_report.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_default_usage_report.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_document.yaml
…
erm_eholdings_package.yaml Bug 37577: Add additional fields for ERM packages 2024-11-08 16:09:19 +01:00
erm_eholdings_package_agreement.yaml
…
erm_eholdings_resource.yaml
…
erm_eholdings_title.yaml Bug 40192: Add additional fields support to ERM titles 2026-01-22 09:25:57 -07:00
erm_license.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_license_agreement.yaml
…
erm_sushi_service.yaml Bug 39007: Update API spec and unit test 2025-01-31 15:57:32 +01:00
erm_usage_data_provider.yaml
…
erm_usage_database.yaml
…
erm_usage_item.yaml
…
erm_usage_mus.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_usage_platform.yaml
…
erm_usage_title.yaml
…
erm_usage_yus.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
erm_user_role.yaml
…
error.yaml
…
extended_attribute_type.yaml
…
extended_attribute_value.yaml Bug 40541: Add missing new line at the end of files when missing 2025-07-31 12:42:09 -06:00
file_transport.yaml Bug 39190: Rename API from sftp_servers to file_transports 2025-09-19 13:23:25 -06:00
fund.yaml
…
hold.yaml Bug 41456: Fix item type searching and filtering on the holds history table 2025-12-29 09:56:19 -07:00
hold_group.yaml Bug 40529: Add hold group targets logic 2025-11-03 14:13:14 -07:00
holds.yaml
…
identity_provider.yaml
…
identity_provider_domain.yaml Bug 37711: API changes 2025-11-05 07:12:31 -07:00
ill_backend.yaml
…
ill_backends.yaml
…
ill_batch.yaml
…
ill_batches.yaml
…
ill_batchstatus.yaml
…
ill_batchstatuses.yaml
…
ill_request.yaml
…
ill_status.yaml
…
import_batch_profile.yaml
…
import_batch_profiles.yaml
…
import_record_match.yaml
…
invoice.yaml
…
item.yaml Bug 40433: Add missing maxLength to item, library and patron 2025-07-21 14:01:28 -06:00
item_group.yaml
…
item_type.yaml Bug 20644: (follow-up) Fix swagger description + put "inherit" by default 2025-08-22 07:44:59 -06:00
item_type_translated_description.yaml
…
job.yaml Bug 39771: Make `data` attribute nullable for jobs 2025-05-09 09:12:06 +02:00
library.yaml Bug 40433: Add missing maxLength to item, library and patron 2025-07-21 14:01:28 -06:00
list.yaml Bug 28965: Add /public/lists 2024-11-08 16:09:21 +01:00
merge_biblios.yaml
…
order.yaml
…
order_claim.yaml Bug 39830: Add order claim object definition 2025-09-29 14:02:21 -06:00
patron.yaml Bug 28701: Add mexlength to the API spec 2026-01-13 15:20:08 -07:00
patron_account_credit.yaml
…
patron_balance.yaml
…
patron_category.yaml Bug 40179: Add maxLength to patron_category spec file 2025-07-08 15:42:08 -06:00
patron_extended_attribute.yaml
…
preservation_config.yaml
…
preservation_processing.yaml
…
preservation_processing_attribute.yaml
…
preservation_train.yaml
…
preservation_train_item.yaml
…
quote.yaml
…
recall.yaml
…
recalls.yaml
…
record_source.yaml
…
renewal.yaml
…
renewals.yaml
…
return_claim.yaml
…
rota.yaml
…
search_filter.yaml
…
sip2_account.yaml Bug 37893: (QA follow-up): Remove plaintext password storage from SIP2 2025-11-18 11:21:06 -07:00
sip2_institution.yaml Bug 37893: REST API specs 2025-11-18 11:20:44 -07:00
sip2_system_preference_override.yaml Bug 37893: SIP2 System preference overrides 2025-11-18 11:20:56 -07:00
smtp_server.yaml
…
suggestion.yaml Bug 33430: (follow-up) Fix API spec terminology 2025-05-19 18:54:23 +02:00
ticket.yaml
…
ticket_update.yaml
…
transfer_limit.yaml
…
vendor.yaml Bug 38207: Update UI to use new field 2026-01-22 09:26:04 -07:00
vendor_alias.yaml Bug 39838: Add `vendor_alias` definition in swagger 2025-05-13 18:47:03 +02:00
vendor_interface.yaml Bug 39837: Add definition in swagger 2025-05-13 18:47:06 +02:00
vendor_issue.yaml
…
vendors_config.yaml Bug 38208: Provide a link from vendors to ERM 2025-11-03 14:13:34 -07:00