AirbnbSDK icon indicating copy to clipboard operation
AirbnbSDK copied to clipboard

Doctrine\Common\Annotations\AnnotationException

Open dave7280 opened this issue 7 years ago • 5 comments

Doctrine\Common\Annotations\AnnotationException Semantical Error The annotation "@JMS\Serializer\Annotation\Type" in property AirbnbSDK\Response\Listing\ListingResponse::$listing does not exist, or could not be auto-loaded.

dave7280 avatar Apr 13 '17 16:04 dave7280

I'm having the same issue.

mtownsend5512 avatar Jul 31 '17 18:07 mtownsend5512

Hello i am having the same issue...

Please provide a solution

dimitrisGiannakakis avatar Aug 16 '18 11:08 dimitrisGiannakakis

Try to download library then modify source code by removing annotation that it complain about:

@JMS\Type("AirbnbSDK\Response\Listing\Listing\Listing")

from

https://github.com/JonnyD/AirbnbSDK/blob/650f7568c46549a378aa14d6d0e1b06eb77d583d/src/AirbnbSDK/Response/Listing/ListingResponse.php

I didn't test, but maybe it's gonna work. I remember that i somehow solved it by modifying source.

dave7280 avatar Aug 23 '18 22:08 dave7280

Dont work for me. Who have a solution ? Thank you

piep14 avatar Jan 21 '19 21:01 piep14

This is a bit of a brutal hack, but it seems to have worked for me:

Find the following file:

https://github.com/JonnyD/AirbnbSDK/blob/master/src/AirbnbSDK/HttpClient/HttpClient.php

Replace line 124:

$response = $serializer->deserialize($contents, $deserializeTo, 'json');

with:

$response = json_decode($contents);

The issue seems to be with the framework that is parsing the otherwise healthy result that is coming back from AirBnB. The hack circumvents the whole framework and just does a simple translate from JSON to a PHP Object.

I'm not sure what wider implications this has, or whether I'll need to hack some other parts also to make everything work, but for now, the listings search works, and that was my primary objective. Happy coding!

dearsina avatar Mar 07 '19 09:03 dearsina