Bug 40220 - API Incorrectly Requires Mandatory Extended Attributes Not Visible in OPAC
Summary: API Incorrectly Requires Mandatory Extended Attributes Not Visible in OPAC
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Leo Stoyanov
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-23 14:21 UTC by Leo Stoyanov
Modified: 2025-06-23 15:58 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40220: Added Consderation of API Interface for Mandatory Extended Attributes (1.47 KB, patch)
2025-06-23 15:58 UTC, Leo Stoyanov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Stoyanov 2025-06-23 14:21:37 UTC
When registering patrons via /api/v1/patrons, the endpoint requires ALL mandatory extended attributes, including those not set to "Editable in OPAC". This is inconsistent with OPAC behavior, where only attributes that are both mandatory and visible/editable in OPAC are required. For external systems acting as OPAC replacements, such as Aspen Discovery, this creates unnecessary validation failures.
Comment 1 Leo Stoyanov 2025-06-23 15:58:14 UTC
Created attachment 183422 [details] [review]
Bug 40220: Added Consderation of API Interface for Mandatory Extended Attributes

Test Plan:
1. Create an extended borrower attribute with: mandatory = 1 (checked), opac_display = 1, and opac_editable = 0 (unchecked - not editable in OPAC).
2. Setup your Postman, or any other mock API software, to obtain an OAuth token (/api/v1/oauth/token) and to register a patron (/api/v1/patrons).
3. With the OAuth token, send a POST request to /api/v1/patrons with valid patron data and missing mandatory extended attribute data.
4. Observe the API response wtih the 400 error. Despite this attribute not being required in the OPAC, the API requires it.
5. Apply the patch and repeat step 3. Observe the API response with the patron data returend, indicating the patron has been created.