Summary
Certain endpoints for handling Parsoid metadata and linter errors currently rely on RESTBase. These endpoints need to be rerouted to equivalent MediaWiki REST endpoints as part of the ongoing RESTBase sunset process. This will help standardize calls to the MediaWiki REST API.
Mapping of production URLs to be routed to MediaWiki-REST-API
Linter Errors
- Get linter errors for a title
- Current Endpoint: <domain>/api/rest_v1/page/lint/{title}
- MW REST Endpoint: <domain>/w/rest.php/v1/page/{title}/lint
- Details:
- Parameter: {title}
- Headers: Include x-restbase-compat with a value of true
- Response: Linter errors in JSON
- Get linter errors for a specific title/revision
- Current Endpoint: <domain>/api/rest_v1/page/lint/{title}/{revision}
- MW REST Endpoint: <domain>/w/rest.php/v1/revision/{id}/lint
- Details:
- Parameters: {title}, {revision}
- Headers: Include x-restbase-compat with a value of true
- Response: Linter errors in JSON
Additional Configuration
- All forwarded calls must include the header x-restbase-compat: true to ensure RESTBase-compatible responses.
- Ensure proper handling of redirects (301 and 302) and document behavior for query parameters like redirect=false.
Update on /page/data-parsoid
- The /page/data-parsoid endpoint will be sunset and tracked at T393557
Acceptance Criteria
- Rerouted endpoints are functional and return expected responses from the MW REST API.
- The rerouting process is validated and approved by:
- @MSantos
- @HCoplin-WMF
- Content-Transform-Team
- ServiceOps (once the initial review is completed)
- All calls are routed through REST Gateway for production use.