Closed Mcrich23 closed 2 years ago
FWIW I'm seeing something similar when searching particular categories of restaurants and also when searching by closest distance. I'm investigating it further too to see exactly where the mismatch is for decoding.
I've found that the problem has to do with the decoding of image_url. I had to make a change to CDYelpBusiness:
public let imageUrl: URL?
became
public let imageUrl: String?
This seems to be because it can't decode it into a URL when the JSON response has "" for image_url.
Thx
Thanks for bringing this up @Mcrich23 . And thanks for opening a PR @davecom . Sorry about the slow response. I'll take a look this week.
@Mcrich23 @davecom this should be fixed with 3.2.0
. Can you confirm?
It works!!!! @chrisdhaan
Thanks for confirming. Closing since #36 addressed this issue.
What did you do?
I tried to search for Food Trucks by using seachBusinesses(byTerm: "Food Trucks", ...) and also trying using seachBusinesses(byTerm: "", ..., categories [.foodTrucks], ...)
What did you expect to happen?
It to fetch correctly
What happened instead?
It came back with an error saying that it was unable to decode, because it was an invalid format.
CDYelpFusionKit Environment
CDYelpFusionKit version: 3.0.0
Xcode version: 13.2.1
Swift version: 5.5
Platform(s) running CDYelpFusionKit: iOS, iPadOS
macOS version running Xcode: 12.3 beta
Demo Project
https://drive.google.com/file/d/1CJwc-CND6TY_4-auPCd7GU_hQTbK9XMw/