Page MenuHomePhabricator

In the new, public API end-point to call Wikifunctions, don't wrap response contents in a "query" object or pass on a "success" flag
Closed, ResolvedPublic

Description

Currently, the response of the wikilambda_function_call API action is wrapped in a query member, which contains a wikilambda_function_call member, like so (example API call):

$ curl -s 'https://www.wikifunctions.org/w/api.php?action=wikilambda_function_call&wikilambda_function_call_zobject=\{"Z1K1":"Z7","Z7K1":"Z11602","Z11602K1":"abcde"\}&format=json' | jq .
{
  "query": {
    "wikilambda_function_call": {
      "success": "",
      "data": "(snip)"
    }
  }
}

To me this seems quite confusing – it suggests that the response came from an action=query request, which is not the case (and a real response from the query action would look different). Can we perhaps remove it while it’s still possible to make breaking API changes without breaking too much other code, and make wikilambda_function_call the top-level member?

Event Timeline

Change 1013158 had a related patch set uploaded (by David Martin; author: David Martin):

[mediawiki/extensions/WikiLambda@master] Remove 'query' layer from the result of ApiFunctionCall

https://gerrit.wikimedia.org/r/1013158

Jdforrester-WMF renamed this task from Remove "query" member of wikilambda_function_call API response to In the new, public API end-point to call Wikifunctions, don't wrap response contents in a "query" object or pass on a "success" flag .Mar 21 2024, 5:31 PM
Jdforrester-WMF changed the task status from Open to In Progress.
Jdforrester-WMF assigned this task to DMartin-WMF.
Jdforrester-WMF triaged this task as High priority.

Change #1013437 had a related patch set uploaded (by David Martin; author: David Martin):

[mediawiki/extensions/WikiLambda@master] Provide a new, public API end-point based on `wikilambda_function_call`

https://gerrit.wikimedia.org/r/1013437

Change #1013437 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Provide a new, public API end-point based on `wikilambda_function_call`

https://gerrit.wikimedia.org/r/1013437