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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidationFailedException error structure changed. #60

Closed
cberio opened this issue Aug 16, 2017 · 2 comments
Closed

ValidationFailedException error structure changed. #60

cberio opened this issue Aug 16, 2017 · 2 comments

Comments

@cberio
Copy link
Contributor

cberio commented Aug 16, 2017

first of all, thanks for your efforts. 馃憤

after migrate from 1.* to 2.*, I found a undocumented changes.
I just leave this issue for others.

2.*
https://github.com/flugger/laravel-responder/blob/77c90a6991570d96377ee87b7c54a2e676369d15/src/Exceptions/Http/ValidationFailedException.php#L55-L58

{
    "status": 422,
    "success": false,
    "error": {
        "0": {
            "some_fields": [
                "messages"
            ]
        },
        "code": "validation_failed",
        "message": "The given data failed to pass validation."
    }
}

1.*
https://github.com/flugger/laravel-responder/blob/f8044cafde230602d35da1dcc5e609e3c04aeeab/src/Exceptions/Http/ValidationFailedException.php#L54-L57

{
    "success": false,
    "status": 422,
    "error": {
        "code": "validation_failed",
        "message": "The given data failed to pass validation.",
        "fields": {
            "some_fields": [
                "messages"
            ]
        }
    }
}
@flugg
Copy link
Owner

flugg commented Aug 16, 2017

Hey! Appreciate the kind words and thanks for reporting the issue. This is not the expected behaviour and the missing 'fields' key must have slipped out accidentally. I will get it fixed and tag a release!

@flugg
Copy link
Owner

flugg commented Aug 16, 2017

A 2.0.5 version has been tagged which should add the fields key again. Please let me know if you meet more problems :)

@flugg flugg closed this as completed Aug 16, 2017
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

No branches or pull requests

2 participants