Page MenuHomePhabricator

Fix type, media type, and array issues in the MediaWiki REST API OAD
Closed, ResolvedPublic3 Estimated Story Points

Description

Fix linter issues related to types, media types, and arrays (30 matches) in the MediaWiki REST API OAD:

  • Add types to schema properties (wikimedia-response-schema-properties-type)
  • Ensure schemas with type: array specify items; after T409113 is done (built-in rule: array-items)
  • Ensure all responses have valid media types (wikimedia-response-valid-media-type)
  • Ensure all media types are valid (wikimedia-valid-media-type)

Note that only global properties and properties under paths starting with /v1/ are in scope for this task.

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Rules: allow valid media types and handle polymorphic propertiesrepos/ci-tools/wikimedia-spectral-ruleset!14milazgmgoncalves/T428149main
Customize query in GitLab

Event Timeline

KBach triaged this task as Medium priority.
KBach renamed this task from Fix type, media type, and array issues in the MW REST API OAD to Fix type, media type, and array issues in the MediaWiki REST API OAD.Jun 4 2026, 12:01 PM
KineticPelagic subscribed.

As part of my Clinic Duty rotation, I add a project tag and move this task to "To Estimate" because the task is clear enough to be sized and valuable in our current hypothesis.

Notes for estimation:

  • Work involves adding missing type fields to response schema properties and fixing invalid media type strings in the REST handler classes
  • Changes are spread across multiple handler PHP files but are purely additive — no logic changes, low risk
  • The array-items portion is still blocked on T409113 and should be excluded from the estimate
  • Verification is done by running the linter against the generated document
AGhirelli-WMF set the point value for this task to 3.Jun 11 2026, 3:37 PM
MGoncalves-WMF changed the task status from Open to In Progress.Tue, Jun 23, 5:30 PM

Change #1304825 had a related patch set uploaded (by Aghirelli; author: Milazg):

[mediawiki/core@master] REST: Update schema definitions for array types and operation tags

https://gerrit.wikimedia.org/r/1304825

Change #1304825 merged by jenkins-bot:

[mediawiki/core@master] REST: Update schema definitions for array types and operation tags

https://gerrit.wikimedia.org/r/1304825

Change #1306686 had a related patch set uploaded (by Milazg; author: Milazg):

[mediawiki/core@master] REST: add explicit type to schema properties

https://gerrit.wikimedia.org/r/1306686

Change #1306686 merged by jenkins-bot:

[mediawiki/core@master] REST: add explicit type to schema properties

https://gerrit.wikimedia.org/r/1306686