[API] Expose complete field sets for all endpoints (e.g. Contract, Licenses) #455
Replies: 2 comments
|
The missing fields are a good example of why the API should not rely on a small hand-maintained response allowlist for every resource. At the same time, exposing every database column blindly can bypass permissions or return implementation details that the UI never intended to publish. A useful design would be a versioned resource field schema:
For Contract and SoftwareLicense, the examples should become regression fixtures, including null values, dates, relations, and permission-restricted fields. It is also worth checking whether some names are stored under relation IDs while the UI displays resolved labels; the API should expose both in a predictable way rather than changing the meaning of an existing field. A complete field set would be valuable, but I would implement it through a shared resource schema and tests for all endpoints, not by copying the UI's current columns one controller at a time. |
|
The new API is still a work in progress but,
|
Uh oh!
There was an error while loading. Please reload this page.
The High-Level REST API (v2.2.0) returns only a small, hardcoded subset of fields
for several endpoints. Fields that are fully stored in the database and visible in
the GLPI UI are silently omitted from API responses.
Two concrete examples we ran into:
Contract— missing fields include:
begin_date,duration,notice,periodicity,billing,renewal,num,suppliers_id,budgets_id,max_links_allowed,alertSoftwareLicense — missing fields include:
number,expire,softwares_id,softwareversions_id_buy,softwareversions_id_use,buy_date,use_date,is_validThis is likely not limited to these two types — other endpoints may have the
same issue.
Request: Please expose the complete field set for each endpoint, consistent with what the GLPI UI already provides.
Thanks for your amazing work on the project!
All reactions