-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When we tried running listCities() and listCityZones('...'), we got the following error for both:
Unrecognized field "success" (class com.bosta.response.city.ListCityResponse), not marked as ignorable (0 known properties: ])
Source: (String)"{"success":true,"message":"Done successfully","data":[{"_id":"kLvZ5JY6LJPL5chzN","name":"Aswan","nameAr":"أسوان","code":"EG-21","alias":"Aswan","hub":{"_id":"wiu9aiqS9Z89oKedx","name":"Upper Egypt Hub"},"sector":5,"pickupAvailability":false,"dropOffAvailability":true,"showAsDropOffCity":true,"showAsPickupCity":true},{"_id":"7mDPAohM3ArSZmWTm","name":"Assuit","nameAr":"أسيوط","code":"EG-17","alias":"Asyut","hub":{"_id":"-yfYSfnZG","name":"Assiut Hub"},"sector":5,"pickupAvailability":true,"dropOff"[truncated 6816 chars]; line: 1, column: 16] (through reference chain: com.bosta.response.city.ListCityResponse["success"]
Here's the source code:
import com.bosta.BostaClient;
import com.bosta.response.city.ListCityResponse;
String apiKey = '...';
BostaClient client = new BostaClient(apiKey);
ListCityResponse cities = client.listCities();
My guess would be that the api json response has been updated since this library's release, and has more fields than anticipated in ListCityResponse. Two possible solutions:
- Add the missing fields in the class
- Use the ignore unknown fields annotation in Jackson (not recommended though)
On a side note, is this library up to date, or should we use the rest APis instead?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels