Page MenuHomePhabricator

RepoApi.getClaims and wbgetclaims are incoherent
Closed, DeclinedPublic

Description

The documentation says:

src/RepoApi.js
/**
 * Returns `Claim`s of a specific `Entity` by providing an `Entity` id or a specific `Claim` by
 * providing a `Claim` GUID.
 * @see wikibase.api.RepoApi._post
 *
 * @param {string|null} entityId `Entity` id. May be `null` if `claimGuid` is specified.
 * @param {string} [propertyId] Only return `Claim`s featuring this `Property`.
 * @param {string} [claimGuid] GUID of the `Claim` to return. Either `claimGuid` or `entityID`
 *        has to be provided.
 * [...]
 */

This API call

repoApi.getClaim( null, null, 'Q42$D8404CDA-25E4-4334-AF13-A3290BCD9C0F' )

results in an error, though:

{
    "error": {
        "code": "param-illegal",
        "info": "An illegal set of parameters have been used.",
        "messages": [
            {
                "name": "wikibase-api-param-illegal",
                "parameters": [],
                "html": {
                    "*": "An illegal set of parameters have been used."
                }
            }
        ],
        "*": "See https://www.wikidata.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": "mw1286"
}

It happens because the argument entity= is empty (not excluded from the request).