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

Missing model fields for the Shipping API on v6 #673

Closed
bgarret opened this issue Apr 2, 2024 · 3 comments
Closed

Missing model fields for the Shipping API on v6 #673

bgarret opened this issue Apr 2, 2024 · 3 comments
Labels

Comments

@bgarret
Copy link
Contributor

bgarret commented Apr 2, 2024

Problem description:

Hello,

I'm implementing the Shipping V2 API and it looks like there are a few model fields missing while using the getTracking method :

  • The ErrorList has an errorList field, it should be errors.
  • SellingPartnerApi\Seller\ShippingV2\Dto\Event has an optional shipmentType field.
  • SellingPartnerApi\Seller\ShippingV2\Dto\TrackingSummary has an optional trackingDetailCodes field.

Is there documentation on how to regenerate DTO classes? I'm open to fixing this, but I understood that the DTO classes are auto-generated and I couldn't find the process on how to do so.

Thanks again for all your work!

Error:

ErrorList

Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Responses\ErrorList: errors

Fatal error: Uncaught ArgumentCountError: Too few arguments to function SellingPartnerApi\Seller\ShippingV2\Responses\ErrorList::__construct(), 0 passed in /var/www/vendor/highsidelabs/saloon-sdk-generator/src/Traits/Deserializes.php on line 74 and exactly 1 expected in /var/www/vendor/jlevers/selling-partner-api/src/Seller/ShippingV2/Responses/ErrorList.php:15

Event and TrackingSummary

Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Dto\Event: shipmentType
Warning: Unknown keys when deserializing into SellingPartnerApi\Seller\ShippingV2\Dto\TrackingSummary: trackingDetailCodes

Code

try {
    /** @var ShippingV2\Responses\GetTrackingResponse $response */
    $response = $api->getTracking($tracking, "AMZN_FR")->dto();
} catch (\Saloon\Exceptions\Request\ClientException $e) {
    $e->getResponse()->dto();
    var_dump($e->__toString());
}
@jlevers
Copy link
Owner

jlevers commented Jun 11, 2024

Thanks for the offer to contribute! I didn't have good instructions until just now – they're in CONTRIBUTING.md. That said, these issues are fixed and will be released in v7 soon :)

@jlevers jlevers added the v7.x label Jun 11, 2024
@bgarret
Copy link
Contributor Author

bgarret commented Jun 11, 2024

Thanks for your work, it's very very cool that you opened the development process. I skimmed the contribution docs and made a few changes in #730 , to hopefully make it clearer.

I saw you bumped the minimum version to PHP 8.2, is this a hard requirement? PHP 8.1 is still on security support until 31 Dec 2025, we haven't migrated to a newer version yet, this would prevent us from upgrading 😞

@jlevers
Copy link
Owner

jlevers commented Jun 19, 2024

Released in v7.0.0.

Re: the PHP 8.2 situation – it would take a lot of dependency juggling (including on highsidelabs/saloon-sdk-generator) to get this library fully PHP 8.1 compatible. If you want to submit PRs to that repo and to this one that gets things working with PHP 8.1 I'm happy to review them, but I think I'm unlikely to do that myself anytime soon.

@jlevers jlevers closed this as completed Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants