-
Notifications
You must be signed in to change notification settings - Fork 474
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
Convert json_response_body_names to array #1208
Conversation
af2a839
to
17c1848
Compare
session: @session, instance: self | ||
) | ||
response_name = self.class.json_response_body_names & response.body.keys | ||
self.class.create_instance(data: response.body[response_name.first], session: @session, instance: self) |
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.
Is there any risk for response.body.keys
not containing any of the json_response_body_names
?
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.
there is, but no riskier than the previous code, sorbet would throw the nil error
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.
I think this mostly make sense to me!
368b9cb
to
37120da
Compare
37120da
to
07de972
Compare
* Convert json_response_body_names to array to allow multiple names * Fix customer address all not returning repsonse * Remove failing tests * Add changelog entry
Description
Fixes #1018
Fixes #1190
Allowing multiple response body names to be passed in so we can check and build a response based on what key matches the for the class
How has this been tested?
Created a fresh app and pre-populated test store and made sure we can create a fulfillment request without sorbet error
Get a response back from CustomerAddress.all
Checklist:
I have updated the project documentation.