As per T361995 JsonBodyValidator from Mediawiki REST API is discontinued in favor of a new mechanism (T358560)
Wikibase REST API should stop using the deprecated class.
Implementation notes:
- for each POST/PUT/PATCH/DELETE route handler
- remove getBodyValidator
- move any field definitions that were previously in getBodyValidator to getBodyParamSettings
- remove assertContentType and move the expected content types to getSupportedRequestTypes()
- override Handler::validate() and add assertValidTopLevelTypes check to it (see example patch)
- adjusts e2e tests according to the new expected responses
- see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1049935 for an example
- remove TypeValidatingJsonBodyValidator
- add application/json-patch+json to any PATCH endpoint e2e tests that are missing it, see e.g. repo/rest-api/tests/mocha/api-testing/PatchPropertyStatementTest.js once https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1049848 is merged