Skip to content

Custom error message  #239

Closed
Closed
@csimplestring

Description

@csimplestring

Hi, it is great to support customized error message in the 1.6.0 release. But after reading the source code for a while, I notice a minor issue during adding error:

$this->addError($path, 'The item ' . $i . '[' . $k . '] is not defined and the definition does not allow additional items', 'additionalItems', array('additionalItems' => $schema->additionalItems,));

The problem is that the 'not-allowed' field '$i' and '$k' is in the error message, external users have to parse it from error message. Once the error message is changed, external users have to change parsing accordingly.

Therefore to fully support customized error message, the error message should not contain any error field path, e.g., '$i', '$k', which shall be moved to '$path' instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions