Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more precise json/array error messages #225

Merged
merged 2 commits into from
Feb 25, 2021

Conversation

norberttech
Copy link
Member

@norberttech norberttech commented Feb 24, 2021

Change Log

Added

Fixed

Changed

  • error message for json/array/chain matchers are now more precise

Removed

Deprecated

Security


Description

This is best I could think so far, instead of displaying generic message with value and pattern, phpmatcher will collect all failed comparisons with their paths.
This should generate an output similar to:

value:

[
    {
        "user": {
             "login": "norbertech"
         }
    }
]

pattern:

[
    {
        "user": {
             "login": "@integer@"
         }
    }
]

error message:

Value "norberttech" does not match pattern "@integer@" at path: "[0][user][login]"

@ostrolucky
Copy link

Yes this result looks much better.

@lchrusciel
Copy link

Looks awesome! And much more precise

@norberttech norberttech merged commit e4e59ee into coduo:6.x Feb 25, 2021
@norberttech norberttech deleted the feature/json-matcher-error branch February 25, 2021 19:17
@bendavies
Copy link
Contributor

awesome - thankyou!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants