cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to load API definition

Failed to load API definition

I have this error when i try to test API using swagger. Can anybody help meScreenshot from 2022-07-06 16-56-15.png

2 REPLIES 2

Re: Failed to load API definition

Simply you can look into the log in the Output window. The actual error can be seen there in my case, I missed adding HTTP action on top of a methods


AlaskasWorld 

Re: Failed to load API definition

@annq3sivn4281 

 

When we add phpdoc in API creation it adds like:

/**
    * @param $orderId
    * @param $mailId
    * @return mixed
*/

You need to replace the above code with:

/**
    * @param int $orderId
    * @param mixed $mailId
    * @return mixed
*/

 

Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.