Page MenuHomePhabricator

mwapi: allow changing api_url after construction
Open, Needs TriagePublicFeature

Description

Currently (AFAIK) mwapi::Client works under the assumption that applications only work with a single wiki under a single context. However, this isn't always true for applications that operate across wikis and need to obtain information from all over the place.

It should either get methods that allow us to override the original api_url for requests, or have the api_url extracted from the InnerClient.

Event Timeline

XtexChooser renamed this task from mwapi: changing the api_url once built? to mwapi: allow changing api_url after construction.Mar 21 2025, 9:43 AM
XtexChooser edited projects, added mwbot-rs (mwapi); removed mwbot-rs.
XtexChooser subscribed.

The token store also needs to be flushed once api_url is updated.

See T319104: mwbot-rs: Support operation on multiple wikis. I had always imagined that mwbot would have the logic to support multi-wiki operation and mwapi would continue to stay single-wiki for simplicity. I'm not really fixed on that concept and would love to see some progress on this, so feel free to give it a shot.