Page MenuHomePhabricator

ExtensionRegistration schema: An array of valid value types is not respected in error message
Closed, ResolvedPublic

Description

If an allowed value type for a property is defined as an array, like:

"ExtensionFunctions": {
	"type": [
		"array",
		"string"
	],
	"description": "Function to call after setup has finished",
	"items": {
		"type": "string"
	}
},

the error message, if a value does not conform to this schema, is somtheing like:
[ExtensionFunctions] Object value found, but a string is required

while it should be something like:
[ExtensionFunctions] Object value found, but an array, a string or an integer is required

The error message is misleading, as it indicates, that only the type string is valid, while in fact other types are valid, too. The error mesage should indicate all valid types, instead of just one of them.

Event Timeline

Legoktm triaged this task as Medium priority.Jul 25 2016, 11:46 PM
Legoktm added a project: Upstream.

Thanks for submitting an upstream patch @Florian :)

Ok, the upstream change is merged. We now need to wait some time for the next release. However, this would need some more testing, as we would need to upgrade to a new major version (we currently use ~1.6 and would need to update to something like ~2.0. I'll do that, once there's a new release.

Change 304863 had a related patch set uploaded (by Florianschmidtwelzow):
Upgrade justinrainbow/json-schema to ~3.0

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

Change 305340 had a related patch set uploaded (by Florianschmidtwelzow):
Synchronize JsonSchema with mediawiki/core

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

Change 305343 had a related patch set uploaded (by Florianschmidtwelzow):
Synchronize JsonSchema with mediawiki/core

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

Change 305344 had a related patch set uploaded (by Florianschmidtwelzow):
Synchronize JsonSchema with mediawiki/core

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

Change 305360 had a related patch set uploaded (by Florianschmidtwelzow):
Upgrade justinrainbow/json-schema to ~3.0

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

Change 305344 merged by Seb35:
Synchronize JsonSchema with mediawiki/core

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

Change 305360 merged by jenkins-bot:
Upgrade justinrainbow/json-schema to 3.0.0

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

Change 304863 merged by jenkins-bot:
Upgrade justinrainbow/json-schema to ~3.0

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

Change 305340 merged by jenkins-bot:
Synchronize JsonSchema with mediawiki/core

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

Change 305343 merged by jenkins-bot:
Synchronize JsonSchema with mediawiki/core

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