Page MenuHomePhabricator

Add validator to EntitySchema data type definition
Closed, ResolvedPublic

Description

The validator should enforce:

  • that the value matches the pattern for an EntitySchema ID (make sure the match is case-sensitive too!); and
  • that an EntitySchema with this ID actually exists (it may be deleted later, but we should enforce existence at the time the value is created).

Compare e.g. the validator-factory-callback of PT:commonsMedia in WikibaseRepo.datatypes.php.

Event Timeline

Lucas_Werkmeister_WMDE added a subscriber: hoo.

Taking this over from Marius, since he’s OoO for a few days and this blocks T332725: [ES-M2]: Enable new EntitySchema data type on Beta Wikidata; I hope that’s okay.

Change 908846 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/EntitySchema@master] Set up initial validators for entity-schema data type

https://gerrit.wikimedia.org/r/908846

Change 908893 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/EntitySchema@master] WIP: Add EntitySchemaExistsValidator

https://gerrit.wikimedia.org/r/908893

Change 908846 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Set up initial validators for entity-schema data type

https://gerrit.wikimedia.org/r/908846

Change 908893 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Add EntitySchemaExistsValidator

https://gerrit.wikimedia.org/r/908893

ItamarWMDE subscribed.

Nice and easy, thank you \o/