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

Extend response with extra information in case of error #551

Open
alevshunov opened this issue Apr 26, 2022 · 0 comments
Open

Extend response with extra information in case of error #551

alevshunov opened this issue Apr 26, 2022 · 0 comments

Comments

@alevshunov
Copy link

When we are saving/updating an entity via agrest using POST/PUT methods and the model is not valid by some rules, the response is looks like: "validation failed, 3 errors". But we have no any extra information about what kind of errors are.

So, it will be nice to have extended error response, something like:

{ 
   success: false, 
   message: "...: validation failed, 3 errors", 
   errors: [
     { field: 'firstName', message: 'firstName is re'}, 
     ... 
   ],
   ...
}
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

1 participant