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

Failure Parsing json #6

Closed
a0n opened this issue Mar 24, 2022 · 3 comments
Closed

Failure Parsing json #6

a0n opened this issue Mar 24, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@a0n
Copy link
Contributor

a0n commented Mar 24, 2022

 2022/03/24 20:24:37 json: cannot unmarshal object into Go struct field .searchResponseModel.resultlist.resultlist.resultlistEntries.resultlistEntry of type []struct { ID string "json:\"@id\""; Publishdate string "json:\"@publishDate\""; ResultlistRealEstate struct { ID string "json:\"@id\""; Title string "json:\"title\""; Price struct { Value float32 "json:\"value\""; Currency string "json:\"currency\"" } "json:\"price\""; LivingSpace float32 "json:\"livingSpace\""; NumberOfRooms float32 "json:\"numberOfRooms\""; CalculatedTotalRent struct { Totalrent struct { Value float32 "json:\"value\""; Currency string "json:\"currency\"" } "json:\"totalRent\"" } "json:\"calculatedTotalRent\"" } "json:\"resultlist.realEstate\"" }
exit status 1

this stops the bot.

I will set up the boot to auto-restart for now.
but would be cool to get to the bottom of why the JSON can't be parsed

@fabihoe
Copy link

fabihoe commented Apr 6, 2022

I have the same problem. Initially, this error would occur after like 1 hour. Now it occurs right after restarting the program. Is it the same for you?

@mustafabayar
Copy link
Owner

mustafabayar commented Apr 7, 2022

Hey, sorry I totally missed open issues. I will try to find out the root cause of this problem. This never happened to me. But I have a suspicion. When I use this bot, I am using with drawn map view url which starts like "https://www.immobilienscout24.de/Suche/shape/wohnung-mieten?shape=", so maybe response format is not always same for diffferent type of searches.
We can parse the response into map of interface to solve the issue maybe. If any of you have time feel free to open PR. I will also try to check it out when I have time.

@mustafabayar
Copy link
Owner

Will handle this in #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants