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

Resource / Attributes is mutating the response.body #49

Closed
col opened this issue Nov 28, 2013 · 0 comments · Fixed by #50
Closed

Resource / Attributes is mutating the response.body #49

col opened this issue Nov 28, 2013 · 0 comments · Fixed by #50

Comments

@col
Copy link
Contributor

col commented Nov 28, 2013

I'd like to be able to access the raw JSON response from a Resource. I've noticed that the Resource class now has an attribute accessor for the response object. Unfortunately there seems to be a bug caused by the Attributes class deleting the '_link' and '_embedded' keys from the representation parameter. When these keys are removed from the representation it mutates the response.body.

I think this can be fixed fairly easily by calling .dup on the response.body when initialising the Resource. Does this sounds like a reasonable solution?

I'm happy to put a pull request together if you agree with the approach.

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 a pull request may close this issue.

1 participant