-
Notifications
You must be signed in to change notification settings - Fork 464
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
fix: Adds as_json to response objects that inherit from Domain. #556
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please describe how you tested this? Thank you!
@@ -31,6 +31,10 @@ def request(method, uri, params = {}, data = {}, headers = {}, auth = nil, timeo | |||
timeout | |||
) | |||
end | |||
|
|||
def as_json(*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be to_json
or as_json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Fixes #555
Fixes #423
Prevents a stack level too deep error when
to_json
is 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
Domain
class and sinceto_json
andas_json
are 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.