MantisBT: master 84c82397

Author Committer Branch Timestamp Parent
dombn community master 2026-11-21 10:44 master 4dd73a09
Affected Issues  0034578: API - allow access to obsolete/inherited versions
Changeset

Allow filtering project versions in REST API

GET /projects/{id}/versions ignored the released, obsolete and inherit
query parameters, although VersionGetCommand supports them. Obsolete
versions could therefore not be retrieved via the REST API at all.

Parameters are only passed on to the command when present, so the
default behavior is unchanged and released keeps its "all versions"
state when omitted. Values are converted with gpc_string_to_bool(),
since version_get_all_rows() checks obsolete with === false and a raw
"0" string would otherwise include obsolete versions. Non-scalar
values are rejected with HTTP 400.

Also documents the parameters in the OpenAPI definition and adds REST
tests for the obsolete and released filters.

Fixes 0034578, PR https://github.com/mantisbt/mantisbt/pull/2313

mod - api/rest/mantisbt_openapi.yaml Diff File
mod - api/rest/restcore/projects_rest.php Diff File
mod - tests/rest/RestProjectVersionTest.php Diff File