⚓ T416831 REST Handler: getResponseBodySchemaFileName should support names relative to module definition file
Page Menu
Phabricator
Create Task
Maniphest
T416831
REST Handler: getResponseBodySchemaFileName should support names relative to module definition file
Closed, Resolved
Public
3 Estimated Story Points
Actions
Edit Task
Edit Related Tasks...
Create Subtask
Edit Parent Tasks
Edit Subtasks
Merge Duplicates In
Close As Duplicate
Edit Related Objects...
Edit Commits
Edit Mocks
Mute Notifications
Protect as security issue
Assigned To
AGhirelli-WMF
Authored By
daniel
Feb 9 2026, 9:21 AM
2026-02-09 09:21:05 (UTC+0)
Tags
MediaWiki-REST-API
(Backlog)
MW-Interfaces-Team (MWI-Sprint-27 (2026-02-10 to 2026-02-24))
(Demo Ready!)
MW-1.46-notes (1.46.0-wmf.17; 2026-02-24)
Referenced Files
None
Subscribers
Aklapper
BPirkle
daniel
Description
Currently, getResponseBodySchemaFileName() is expected to return a patch relative to the wiki's installation path. That's ok for core modules, but bad for extensions. A REST hanlder in an extension would have to return something like
'extensions/MyExtension/src/Api/schema/FooResponseSchema.json'
. But MediaWiki supports installing extensions in different locations, using arbitrary directory names. So` extensions/MyExtension` could simply be wrong.
Instead of using a path relative the the mediawiki installation root, getResponseBodySchemaFileName() should return a path relative to the endpoint's module definition file. The Module object would then resolve it. Specifically, SpecBasedModule would resolve relative the the module definition file. ExtraRoutesModule would probably still use the wiki's installation root. This would also be useful for backwards compatibility.
Afterthought
: Extensions can rely on
__DIR__
to generate a relative path. Not quite as nice, but an easy fix, e.g.:
__DIR__ . '/schema/FooResponseSchema.json'
Details
Related Changes in Gerrit:
Subject
Repo
Branch
Lines +/-
AttributionRestHandler: Use absolute path for schema file
mediawiki/extensions/WikimediaCustomizations
master
+1
-1
REST Handler: Use absolute paths for response body schema files
mediawiki/core
master
+59
-27
REST Handler: Use absolute paths for response body schema files
mediawiki/core
master
+55
-104
Customize query in gerrit
Related Objects
Mentions
Mentioned In
T424127: REST API loads route files relative to the current directory
Event Timeline
daniel
created this task.
Feb 9 2026, 9:21 AM
2026-02-09 09:21:05 (UTC+0)
Restricted Application
added a project:
Moderator-Tools-Team
View Herald Transcript
Feb 9 2026, 9:21 AM
2026-02-09 09:21:06 (UTC+0)
Restricted Application
added a subscriber:
Aklapper
View Herald Transcript
BPirkle
triaged this task as
Medium
priority.
Feb 9 2026, 5:21 PM
2026-02-09 17:21:23 (UTC+0)
BPirkle
edited projects, added
MediaWiki-REST-API
; removed
Moderator-Tools-Team
MediaWiki-Recent-changes
BPirkle
moved this task from
Incoming (Needs Triage)
to
Backlog
on the
MW-Interfaces-Team
board.
BPirkle
subscribed.
Comment Actions
I'm assuming that this being tagged as recent changes was a mistake. Replaced that with rest api and removed moderator tools team tag.
AGhirelli-WMF
claimed this task.
Feb 10 2026, 4:26 PM
2026-02-10 16:26:20 (UTC+0)
daniel
added a comment.
Feb 10 2026, 9:26 PM
2026-02-10 21:26:59 (UTC+0)
Comment Actions
In
T416831#11597985
@BPirkle
wrote:
I'm assuming that this being tagged as recent changes was a mistake. Replaced that with rest api and removed moderator tools team tag.
Huh. Thanks :)
daniel
updated the task description.
(Show Details)
Feb 10 2026, 9:29 PM
2026-02-10 21:29:46 (UTC+0)
daniel
updated the task description.
(Show Details)
AGhirelli-WMF
changed the task status from
Open
to
In Progress
Feb 10 2026, 10:06 PM
2026-02-10 22:06:36 (UTC+0)
gerritbot
added a comment.
Feb 10 2026, 11:53 PM
2026-02-10 23:53:08 (UTC+0)
Comment Actions
Change #1238450 had a related patch set uploaded (by Aghirelli; author: Aghirelli):
[mediawiki/core@master] REST Handler: Support resolving schema file paths relative to module definition file
gerritbot
added a project:
Patch-For-Review
Feb 10 2026, 11:53 PM
2026-02-10 23:53:09 (UTC+0)
AGhirelli-WMF
edited projects, added
MW-Interfaces-Team (MWI-Sprint-27 (2026-02-10 to 2026-02-24))
; removed
MW-Interfaces-Team
Feb 11 2026, 2:15 PM
2026-02-11 14:15:11 (UTC+0)
AGhirelli-WMF
moved this task from
Committed
to
In Progress
on the
MW-Interfaces-Team (MWI-Sprint-27 (2026-02-10 to 2026-02-24))
board.
OWresch-WMF
set the point value for this task to
Feb 12 2026, 4:18 PM
2026-02-12 16:18:42 (UTC+0)
AGhirelli-WMF
moved this task from
In Progress
to
Code Review
on the
MW-Interfaces-Team (MWI-Sprint-27 (2026-02-10 to 2026-02-24))
board.
Feb 12 2026, 11:36 PM
2026-02-12 23:36:32 (UTC+0)
gerritbot
added a comment.
Feb 17 2026, 12:38 PM
2026-02-17 12:38:07 (UTC+0)
Comment Actions
Change #1239926 had a related patch set uploaded (by Aghirelli; author: Aghirelli):
[mediawiki/core@master] REST Handler: Use absolute paths for response body schema files
gerritbot
added a comment.
Feb 17 2026, 12:52 PM
2026-02-17 12:52:53 (UTC+0)
Comment Actions
Change #1239926
abandoned
by Aghirelli:
[mediawiki/core@master] REST Handler: Use absolute paths for response body schema files
Reason:
It is a new commit created by mistake
gerritbot
added a comment.
Feb 18 2026, 2:24 PM
2026-02-18 14:24:14 (UTC+0)
Comment Actions
Change #1238450
merged
by jenkins-bot:
[mediawiki/core@master] REST Handler: Use absolute paths for response body schema files
Maintenance_bot
removed a project:
Patch-For-Review
Feb 18 2026, 2:30 PM
2026-02-18 14:30:54 (UTC+0)
gerritbot
added a comment.
Feb 18 2026, 2:55 PM
2026-02-18 14:55:07 (UTC+0)
Comment Actions
Change #1240296 had a related patch set uploaded (by Aghirelli; author: Aghirelli):
[mediawiki/extensions/WikimediaCustomizations@master] AttributionRestHandler: Use absolute path for schema file
gerritbot
added a project:
Patch-For-Review
Feb 18 2026, 2:55 PM
2026-02-18 14:55:08 (UTC+0)
AGhirelli-WMF
moved this task from
Code Review
to
Demo Ready!
on the
MW-Interfaces-Team (MWI-Sprint-27 (2026-02-10 to 2026-02-24))
board.
Feb 18 2026, 2:58 PM
2026-02-18 14:58:13 (UTC+0)
ReleaseTaggerBot
added a project:
MW-1.46-notes (1.46.0-wmf.17; 2026-02-24)
Feb 18 2026, 3:00 PM
2026-02-18 15:00:40 (UTC+0)
gerritbot
added a comment.
Feb 19 2026, 12:21 AM
2026-02-19 00:21:57 (UTC+0)
Comment Actions
Change #1240296
merged
by jenkins-bot:
[mediawiki/extensions/WikimediaCustomizations@master] AttributionRestHandler: Use absolute path for schema file
Maintenance_bot
removed a project:
Patch-For-Review
Feb 19 2026, 12:30 AM
2026-02-19 00:30:46 (UTC+0)
HCoplin-WMF
closed this task as
Resolved
Feb 26 2026, 6:24 PM
2026-02-26 18:24:10 (UTC+0)
daniel
mentioned this in
T424127: REST API loads route files relative to the current directory
Wed, Apr 22, 11:23 AM
2026-04-22 11:23:29 (UTC+0)
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct.
Wikimedia Foundation
Code of Conduct
Disclaimer
CC-BY-SA
GPL
Credits