Description
By default, our API sandboxes (Action & REST) execute calls against the production environment they are running in. While this is safe and convenient for pulling real world data for GET requests, it introduces some risk of erroneous edits going through unintentionally for endpoints that edit content (eg POST, PUT, PATCH, and DELETE endpoints). It is also slightly confusing since it is called a Sandbox even though the calls are executed in production.
Conditions of acceptance
OpenAPI specs allow for specifying multiple servers the APIs are associated with. Users are then able to select their desired server before executing the calls within the Sandbox. We should utilize this feature to minimize the risk of executing test calls within the API Sandbox.
- Include test.wikimedia.org as a server option within all Wikipedia Special:RestSandbox instances for:
- MediaWiki REST API
- Wikimedia REST API
- Update the server descriptions to clearly specify (Production) and (Sandbox) after the URL body
- Include a small description in the spec info header that recommends using the test wiki for all editing calls, as production is default
OPEN QUESTION: Are there test sites available for other types of projects? Like Wiktionary, Wikivoyage, etc? --> This will be covered in another story; insight from @ArielGlenn
Implementation details
- Wikimedia REST API specs are within the MediaWiki config -- these will have to be updated manually & deployed
- MediaWiki will require a handler/module update for including the new servers in the generated spec process