As we increasingly store content in JSON, usually via ContentHandler, there is a need for a standardized JSON validation system that meets the requirements of Wikimedia projects.
We currently have
two three different solutions deployed to the Wikimedia cluster:
- the JsonSchema class bundled in the EventLogging extension (e.g. used for wiki pages in the Schema namespace on meta.wikimedia.org.)
- the json-schema library included in MediaWiki core. (e.g. used for validating extension.json for extension management).
- the JsonConfig extension's custom validation (e.g. use for wiki pages in the Data namespace on commons.wikimedia.org).
- (more if you count non-php services, like for example Eventgate which uses ajv: https://github.com/wikimedia/eventgate/blob/master/package.json#L36)
None of these are suitable for our needs. We should determine our requirements for a validator and then choose a validator to implement in core.