-
Notifications
You must be signed in to change notification settings - Fork 66
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
Issue with parsing errors on associated models #110
Comments
@glappen looks like maybe you have indeed stumbled on a bug! 😢 |
I need to get it working so maybe I can implement it for Spyke. Can you
perhaps point me to where the logic should go?
Thanks!
…On Mon, Aug 19, 2019 at 1:27 PM Jens Balvig ***@***.***> wrote:
@glappen <https://github.com/glappen> looks like maybe you have indeed
stumbled on a bug!
I believe the hash is in the correct format, but Spyke is not able to
handle nested errors properly yet 🤔
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#110?email_source=notifications&email_token=AAAWWIOPWKY46N3NTXAEF6LQFLJXFA5CNFSM4ILLVED2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4TWLHA#issuecomment-522675612>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAWWIJFW6DFOQGRTYDDANTQFLJXFANCNFSM4ILLVEDQ>
.
|
@balvig I have spent some time reviewing the spyke code, but I am still not sure how best to add this support. Do you have some suggestions on where to start? Thanks! |
@glappen I've added a failing spec here: master...jb/nested-errors The problem seems to be that while Spyke uses Line 108 in f7d7076
...it however doesn't seem to support the |
Hello,
I just encountered an issue where my API returns errors for an associated object. Let's say I have a User model, and a User has-many UserRoles. The errors json returned from my API looks like this:
That is what I get when I call render json: { errors: @user.errors.details } in my API.
The error I get from Spyke is:
Is there any support for Spyke parsing errors for associated objects, or is it only working for attributes one level deep in the model being created? Maybe I'm not putting errors hash into the correct format.
Thanks!
Greg
The text was updated successfully, but these errors were encountered: