netresearch / dhl-module-shipping-m2

This extension is in legacy status since 04/2020 and will run out of maintenance and support after a short transition period. You can find the official replacement extension here https://github.com/netresearch/dhl-shipping-m2. It includes the latest and greatest possible range of functions that DHL is currently offering.
30 stars 21 forks source link

Release 0.10.0 breaks SOAP and REST schema generation in Magento #51

Closed MarcusWolschon closed 5 years ago

MarcusWolschon commented 5 years ago

Bug description

After upgrading from the 0.9.x release to 0.10.0 all SOAP and REST APIs are broken. Removing the /vendor/dhl/module-shipping-m2/etc/webapi.xml file solves the problem as a temporary workaround. (Update: That workaround may break the checkout process. Not confirmed yet.)

Steps to reproduce To reproduce the problem:

  1. Upgrade to dhl/module-shipping-m2 0.10.0 and dhl/lib-shipping-mx 0.10.2
  2. Open https://(Magento2)/swagger/ as a simple test

Expected behavior swagger opens and presents the APIs available to the given api key or the anonymous user

Screenshots / logs instead var/log/exceptions.log shows this: [2019-03-09 16:43:48] main.CRITICAL: Report ID: webapi-5c83ed448f3c4; Message: Class "ServiceInputInterface[]" does not exist. Please note that namespace must be specified. {"exception":"[object] (Exception(code: 0): Report ID: webapi-5c83ed448f3c4; Message: Class "ServiceInputInterface[]" does not exist. Please note that namespace must be specified. at /vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Class "ServiceInputInterface[]" does not exist. Please note that namespace must be specified. at /vendor/magento/framework/Reflection/TypeProcessor.php:140)"} []

The cause seems to be the Dhl\Shipping\Api\Data\Service\ServiceInputInterface class that belongs to dhl-lib-shipping-mx

Environment

FAQ Has the Knowledge Base been checked for a solution?

Mandrino commented 5 years ago

Which Magento version do you use?

This would be a nightmare if true for 2.3 as there would be no workaround on 2.3 as 0.10.0 is the only 2.3 compatible version. We did not yet implement the DHL plug-in as we are first finishing API connections on our new 2.3 development site. As we do have external order and product data processing, a Magento without APIs would be a 100% broken shop for us. Btw. there would not even be any visible front-end if someone already uses PWA as these rely on API connection to the shop for getting their content (we still use theme but some first stores are starting to use PWAs). APIs are a core functionality in Magento 2 going forward, not something only few used like in M1.

ngolatka commented 5 years ago

@MarcusWolschon Thank you very much for reporting this! We will look into it ASAP.

mam08ixo commented 5 years ago

@MarcusWolschon To better understand the impact of this issue: Is it actually the REST APIs which are broken or is it limited to the schema generation? Thanks.

MarcusWolschon commented 5 years ago

Mandrino: I am using Magento 2.2.6 and my description included a workaround unless you need to use the specific DHL interfaces using REST or SOAP.

MarcusWolschon commented 5 years ago

I am using the SOAP API. That's where it happened when calling endpoints with code generated from an existing Schema. As written in the reproduction steps, I was able to reproduct it with Swagger using the REST API.

ngolatka commented 5 years ago

Quick summary The actual REST and SOAP APIs are not broken. If that were the case, the Magento checkout wouldn't work at all, because it relies on REST APIs.

What is broken though is the schema generation, which is indeed a problem. One of the interfaces transported over the web API was annotated via import, not with full namespace, which cannot be handled by Magento's web API mechanism.

What happens next? We are working on the fix and will push it here ASAP. If nothing goes wrong: within the next few days. The fix also requires an update in the lib-shipping-mx which we are going to push at the same time.

ngolatka commented 5 years ago

The new version 0.10.1 has just been released, together with an updated lib-shipping-mx.

@MarcusWolschon Can you confirm that all is well with the world now?

MarcusWolschon commented 5 years ago

Yes, it works

tested: