Page MenuHomePhabricator

[EPIC] Deprecate EventLogging::schemaValidate()
Open, Needs TriagePublic

Description

\MediaWiki\Extension\EventLogging\EventLogging::schemaValidate() allows the caller to validate an object against a JSONSchema. It's not clear which draft of JSONSchema it supports but one code comment suggests that it's pre draft-03.

MediaWiki Core depends on/uses the justinrainbow/json-schema library for validating objects against JSONSchema in production.

All known uses of ::schemaValidate() should be migrated to use the justinrainbow/json-schema library, which supports draft-03 and draft-04, and then the method should be hard deprecated.

TODO

  • Update EventLogging's usage of ::schemaValidate()
  • Update CollaborationKit's usage of ::schemaValidate()
    • CollaborationKit has been archived
  • Update FileAnnotations' usage of ::schemaValidate()
  • Update UploadWizard's usage ::schemaValidate()
  • Hard deprecate ::schemaValidate()
  • Remove ::schemaValidate() and the code in includes/Libs/JsonSchemaValidation after the next MediaWiki release

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
phuedx renamed this task from [EPIC] Deprecate EventLogging::schemaValidate to [EPIC] Deprecate EventLogging::schemaValidate().Feb 12 2024, 10:09 AM

Update FileAnnotations' usage of ::schemaValidate()

I've reached out to @MarkTraceur about FileAnnotations.

Milimetric moved this task from Incoming to READY TO GROOM on the Test Kitchen board.
Milimetric moved this task from READY TO GROOM to Backlog on the Test Kitchen board.
Milimetric moved this task from Backlog to READY TO GROOM on the Test Kitchen board.

See T351879#9437753 for notes on localising validation errors thrown by justinrainbow/json-schema.

Sfaci raised the priority of this task from High to Needs Triage.Nov 4 2025, 8:54 AM
Sfaci moved this task from READY TO GROOM to Tidy up EventLogging on the Test Kitchen board.