Add labels as a value for the wlprop parameter of the action=query&list=watchlist API, and return the label IDs and names if it's set. This is much the same as the existing treatment of tags. The return format format for the label data should match the existing userinfo API format (that was added in T409375).
Derived Requirement
Ensure that the action=query&list=watchlist API supports labels as a valid value for the wlprop parameter and, when requested, returns watchlist label IDs and names using the same response structure as the existing userinfo label format, consistent with how tags are handled.
Test Result - Beta|Prod
Status: ✅ PASS / ❓ Need More Info / ❌ FAIL
Environment: beta/xyzwiki
OS: macOS Tahoe 26.2
Browser: Chrome 143
Device: MBA
Emulated Device: NA
Test Artifact(s): API request URLs and JSON responses from action=query&list=watchlist
Test Steps
Test Case 1: Ensure watchlist API returns label data when wlprop includes labels
- Ensure the user has at least one watched page with one or more labels assigned.
- Send an API request to action=query&list=watchlist with wlprop=ids|title|labels.
- Inspect the JSON response for the watched items.
- ✅❓❌⬜ AC1: The response includes label IDs and names for watched items, using the same data structure as the userinfo label format.
Test Case 2: Ensure label data is not returned when wlprop does not include labels
- Send an API request to action=query&list=watchlist without including labels in the wlprop parameter.
- Inspect the JSON response.
- ✅❓❌⬜ AC2: The response does not include any label-related fields for watched items.
QA Results -Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T416154#11605336 |
| 2 | ✅ | T416154#11605336 |