Skip to content

Unrecognized field "success" (class com.bosta.response.city.ListCityResponse), not marked as ignorable  #5

@marwand

Description

@marwand

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:

  1. Add the missing fields in the class
  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions