Page MenuHomePhabricator

Add config to disallow extra fields in some json schema objects
Closed, ResolvedPublic

Description

Investigation of T301897: Unexpected "isTrusted" value showing up in some author diff output revealed an invalid assumption that json schema defined objects have a closed set of allowed properties by default. As documented upstream, by default any additional properties are allowed. Adding an explicit "additionalProperties": false setting to a "type": "object" definition means no additional properties will be allowed.

For the toolinfo.json schema we should add the "additionalProperties": false setting to all objects other than the "tool" object. This turns out to affect only two defined types, "url_multilingual" and "person" in practice.

Event Timeline

bd808 changed the task status from Open to In Progress.Feb 24 2022, 9:57 PM
bd808 claimed this task.
bd808 triaged this task as Medium priority.
bd808 moved this task from Backlog to In Progress on the Toolhub board.

Change 765650 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[wikimedia/toolhub@main] schema: exclude extra properties for url_multilingual and person types

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

Change 765650 merged by jenkins-bot:

[wikimedia/toolhub@main] schema: exclude extra properties for url_multilingual and person types

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

Change 770638 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/deployment-charts@master] toolhub: Bump container version to 2022-03-15-002555-production

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

Change 770638 merged by jenkins-bot:

[operations/deployment-charts@master] toolhub: Bump container version to 2022-03-15-002555-production

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