fix: Adds as_json to response objects that inherit from Domain.#556
fix: Adds as_json to response objects that inherit from Domain.#556rhuberdeau wants to merge 6 commits intotwilio:mainfrom
Conversation
thinkingserious
left a comment
There was a problem hiding this comment.
Could you please describe how you tested this? Thank you!
| ) | ||
| end | ||
|
|
||
| def as_json(*) |
There was a problem hiding this comment.
Should this be to_json or as_json?
There was a problem hiding this comment.
It should be as_json.
I tested this by updating the gem, locally, and then point my app to the local install. At that point my application did not get an error when calling to_json on an insights object.
There was a problem hiding this comment.
Perhaps a suitable unit test would be to ensure that the data returned by this function is as expected, located here.
There was a problem hiding this comment.
Hi @rhuberdeau,
Just checking back in. Would you like us to take it from here or is this still WIP? Thanks!
|
I can get a test to pass if I run it by itself but when I run it with the
entire suite it fails. I haven't had time to look into why.
…On Tue, Jun 15, 2021 at 9:03 PM Elmer Thomas ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/twilio-ruby/framework/domain.rb
<#556 (comment)>:
> @@ -31,6 +31,10 @@ def request(method, uri, params = {}, data = {}, headers = {}, auth = nil, timeo
timeout
)
end
+
+ def as_json(*)
Hi @rhuberdeau <https://github.com/rhuberdeau>,
Just checking back in. Would you like us to take it from here or is this
still WIP? Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#556 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHV6WFJ52FZBC5NNJEU6LTS7Z47ANCNFSM44XMZQVA>
.
|
|
Do you mind pushing up what you have? Perhaps we can help. Thanks! |
…erdeau/twilio-ruby into feature/add_to_json_support
|
@thinkingserious I merged the most recent and added what I had for tests so far. As I was saying earlier, if you run that one spec it passes but if you run the entire suite it fails. |
|
Any updates on the progress of this PR? |
|
@raquelxmoss @thinkingserious I found the issue and updated the tests. |
|
Hi @rhuberdeau! If you are still working on it, please resolve the conflicts. I can review and merge this change. Else we'll raise a fresh PR for the issue. Thanks! |
Fixes #555
Fixes #423
Prevents a stack level too deep error when
to_jsonis called on a response object.I did not add tests because the issue cannot be replicated at the gem level. However if you would like a test to prove it doesn't break anything I would be happy to include it.
There was no other documentation in the
Domainclass and sinceto_jsonandas_jsonare fairly well known I didn't think it was necessary to add any.Checklist
If you have questions, please file a support ticket, or create a GitHub Issue in this repository.