Templates
This page is a list of MediaWiki templates used to create documentation pages on the API Portal.
Templates for schema tables
| Wikitext | Produces |
|---|---|
| {{string}} | string |
| {{integer}} | integer |
| {{object}} | object |
| {{array}} | array |
| {{optional}} | optional |
| {{required}} | required |
| {{deprecated}} | deprecated |
| {{optional object}} | optional object |
| {{optional query}} | optional query |
| {{optional string}} | optional string |
| {{required string}} | required string |
| {{required array}} | required string |
| {{required boolean}} | required boolean |
| {{required integer}} | required integer |
| {{required number}} | required number |
| {{required object}} | required object |
| {{required path}} | required path |
| {{required query}} | required query |
Nested schemas
| Wikitext | Use case |
|---|---|
| {{Child properties start}} | Add following the description of the parent property, in the same cell, followed by a new table. |
| {{Child properties end}} | Add following the close of the nested table. |
Templates for response examples
| Wikitext | Use case |
|---|---|
| {{Response start}} | Add following the response description in the same cell, preceding <syntaxhighlight lang="json"> |
| {{Response end}} | Add following </syntaxhighlight> |
General purpose templates
Templates for endpoint headings
This wikitext: {{Endpoint|endpoint=/core/v1/{project}/{language}/search/page?q=search terms}}
Produces:
| GET | /core/v1/{project}/{language}/search/page?q=search terms
|
|---|
This wikitext: {{Endpoint|endpoint=/core/v1/{project}/{language}/page/{title} |method=PUT|color=#ac6600|color2=#fef6e7}}
Produces:
| PUT | /core/v1/{project}/{language}/page/{title}
|
|---|
This wikitext: {{Endpoint|endpoint=/core/v1/{project}/{language}/page|method=POST|color=#14866d|color2=#d5fdf4}}
Produces:
| POST | /core/v1/{project}/{language}/page
|
|---|
This wikitext: {{Endpoint|endpoint=/core/v1/{project}/{language}/page/{title}/description |method=DELETE|color=#b32424|color2=#fee7e6}}
Produces:
| DELETE | /core/v1/{project}/{language}/page/{title}/description
|
|---|
Template for curl commands
This wikitext: {{Curl|url=https://api.wikimedia.org/core/v1/wikipedia/en/search/page?q=earth&limit=10|comment=Search English Wikipedia for 10 articles about Earth}}
Produces:
# Search English Wikipedia for 10 articles about Earth
$ curl https://api.wikimedia.org/core/v1/wikipedia/en/search/page?q=earth&limit=10