OpenAPI descriptions generated by MediaWiki should support including examples for request parameters, including:
- path parameters (such as title in GET page/{title})
- query parameters (such as q in GET search/page?q=terms)
- body parameters (such as for POST and PUT requests)
- headers (such as Accept-Language)
- cookie (OpenAPI also supports cookie as a parameter location
These examples make it easier for users to start experimenting with the API, help demonstrate corrects formats, and provide useful content for generating code samples.
OpenAPI example for a path parameter example:
parameters:
title:
name: title
required: true
in: path
description: Page title
example: Earth
schema:
type: stringIn cases where parameter values are translatable, it would be ideal to support translation for these examples.