Jump to content

User:SPage (WMF)/APIExTest

From mediawiki.org

ApiEx

[edit]

Now that I've merged [try in ApiSandbox] support in this diff, these should work

Expand wikitext {{Project:Sandbox}}
Result
{
}

Damn <translate> tags in result!!


sandbox disabled

[edit]
ApiEx with new apisandbox=0 to disable the [Try in ApiSandbox] link.

The above should not show the link because apisandbox=0 (should it be apisandbox=no) to disable?

OK with TNT?!

[edit]

Now try it with the mysterious {{TNT }} in front. From Extension:PageImages:

Sample request:

Request page image for an article.
Result
{
    "query": {
        "normalized": [
            {
                "from": "Lightbox_demo",
                "to": "Lightbox demo"
            }
        ],
        "pages": {
            "162510": {
                "pageid": 162510,
                "ns": 0,
                "title": "Lightbox demo",
                "thumbnail": {
                    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Crystal_Clear_app_korganizer.png/50px-Crystal_Clear_app_korganizer.png",
                    "width": 50,
                    "height": 50
                },
                "pageimage": "Crystal_Clear_app_korganizer.png"
            }
        }
    }
}

Try apisandbox=0 disabled parameter with TNT

[edit]
ApiEx with new showSandboxLink=0

Try apisandbox=1 param with TNT

[edit]

This is the default, but force it anyway.

Sample request:

Request page image for an article.
Result
{
    "query": {
        "normalized": [
            {
                "from": "Lightbox_demo",
                "to": "Lightbox demo"
            }
        ],
        "pages": {
            "162510": {
                "pageid": 162510,
                "ns": 0,
                "title": "Lightbox demo",
                "thumbnail": {
                    "source": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Crystal_Clear_app_korganizer.png/50px-Crystal_Clear_app_korganizer.png",
                    "width": 50,
                    "height": 50
                },
                "pageimage": "Crystal_Clear_app_korganizer.png"
            }
        }
    }
}

what is the mystery ApiEx/Post ?

[edit]

and now with post

Expand wikitext {{Project:Sandbox}}
Result
, what is this
Post parameters
Parameter name Value Default Comment
A different result

ApiEx local tests

[edit]

Originally these were using User:SPage (WMF)/ApiEx, my mod of {{ApiEx }} to add "[try in Sandbox]

See API:Page info in search results, it's using it.


Default

[edit]
basic test invocation
Result
{
dummy result
}

The above should have View in Sandbox

sandbox disabled

[edit]

ApiEx with new showSandboxLink=0

The above should not show the link because sandbox=0 (should it be sandbox=no) to disable?

another

[edit]

From API:Page info in search results Sample query for pageimages and pageterms properties of Albert Einstein:


Stress tests

[edit]

# in API query?

[edit]

(can't)

& in query

[edit]

& alone doesn't work in the api.php link, what about %26 (URL-encoded value?): Test query with %26 (ampersand):

}

Bug: %26 works in the api.php request, but it's re-de-un-encoded to & in the Special:ApiSandbox URL fragment, and so doesn't work.