Skip to content

An array of valid value types is not respected in error message #293

Closed
@FlorianSW

Description

@FlorianSW

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.

Original report in Wikimedia Phabricator: https://phabricator.wikimedia.org/T141281

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions