Page MenuHomePhabricator

"The required parameter \"$1\" was missing." for wbgetclaims on Commons
Open, Needs TriagePublic

Description

This seems to be similar to T185165, but for a different API action.

Using wbgetclaims on the Wikimedia Commons API, I received this error message: "The required parameter \"$1\" was missing."

Is this a bug? It seems like the $1 should be displaying the correct missing parameter name to the user. In this case, it must be entity that was missing, as that is the only required parameter for this action. Not sure if this happens for other API actions or other sites.

I had requested the following: https://commons.wikimedia.org/w/api.php?action=wbgetclaims&format=json&property=P6216entity=M90469568

Note the missing "&", which caused entity parameter to be missing.

{
	"error": {
		"code": "param-missing",
		"info": "The required parameter \"$1\" was missing.",
		"messages": [{
			"name": "wikibase-api-param-missing",
			"parameters": [],
			"html": {
				"*": "The required parameter \"$1\" was missing."
			}
		}],
		"*": "See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
	},
	"servedby": "mw1347"
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 21 2020, 10:44 PM