**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
---
1. **Data-Parsoid Metadata**
- **Current Endpoint:** `/api/rest_v1/page/data-parsoid/{title}/{revision}/{tid}`
- **MW REST Endpoint:** **TBD**
- **Details:**
- Parameters: `{title}`, `{revision}`, `{tid}`
- Headers: Include `x-restbase-compat` with a value of `true`
- Response: Parsoid metadata in JSON
- **Notes:**
- The target endpoint for `data-parsoid` metadata is yet to be determined.
2. **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/transform/wikitext/to/lint/{title}`
- **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/transform/wikitext/to/lint/{title}/{revision}`
- **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`.
---
**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.