Check if data that is going to be deserialized is also empty#815
Check if data that is going to be deserialized is also empty#815nelutihon wants to merge 1 commit intojlevers:mainfrom
Conversation
|
Thanks for the contribution @nelutihon! What problem are you trying to solve here? Using
That means that a boolean |
|
@jlevers I have this error because Amazon returns an empty array as a prep detail This is the error: Too few arguments to function SellingPartnerApi\Seller\FBAInboundV0\Dto\PrepDetails::__construct(), 0 passed in /vendor/jlevers/selling-partner-api/src/Traits/Deserializes.php on line 71 and exactly 2 expected |
|
@nelutihon I understand the issue you're trying to correct: the semantics for what it means to deserialize is not complete, and you're covering a straightforward case of an empty array. You're going with the interpretation that an empty array means a null object. As jlevers pointed out, We've a fork in the road here. We could path is to rewrite the fix on our end instead of having your contribution (lame!). Now for the cooler paths:
In either of those cooler paths you might even add a few tests for different scenarios to cement how deserialization is interpreted in this project, making you not only a bugfinder and bugfixer, but also a contributor to the maturation of a small but important corner of the project. Are you interested in moving forward with one of the cooler paths? |
No description provided.