The Wikimedia OpenAPI linter requires at least one example or examples field under each media type in a requestBody (wikimedia-requestbody-example-exists rule, severity: warn). The framework never generates these fields and provides no mechanism to set them.
Context
Handler::getRequestSpec() only generates schema under each media type in the request body content. There is no hook for example or examples:
'content' => [
'application/json' => [
'schema' => [ ... ]
// ← no 'example' or 'examples'
]
]For path/query *parameters*, PARAM_EXAMPLE was added in T420988. The same pattern is needed for request body content.
32 warnings across all REST modules.
Conditions of acceptance
- Add a way to supply one or more examples for the request body — for example a getRequestBodyExamples() method on the Handler base class (returning null by default, overridable by subclasses).
- When non-null, include the result as example or examples under each media type in the requestBody.content object generated by getRequestSpec().
- Add a unit test verifying examples appear in the generated spec when provided.