0
JSONスキーマnullである:レトロフィット1.9応答
https://gyazo.com/654b65bc293518d8202573ddccfe1b61
私はresults array
でfirst object
をアクセスもしたいが、私はretrofit
thorughそれを取得しようとしたとき、それはresults
配列が空であることを述べています。何故ですか? (jsonschema2pojoから生成)
インタフェース
public interface MapInterface {
@GET("/json")
public void getResults(@Query("location") String location, @Query("radius") double radius,
@Query("type") String type, @Query("key") String key, Callback<Result> response);
}
MainActivity
RestAdapter restAdapter = new RestAdapter.Builder().setEndpoint("https://maps.googleapis.com/maps/api/place/nearbysearch/json?").build();
MapInterface map = restAdapter.create(MapInterface.class);
map.getResults("65.9667,-18.5333", PROXIMITY_RADIUS, "restaurant", placesKey , new Callback<Result>() {
@Override
public void success(Result result, Response response) {
Log.d("Matt", result.getResults().toString());
//this logs `D/Matt: []`
}
@Override
public void failure(RetrofitError error) {
Log.d("Matt", error.getMessage());
}
});
POJO
を試してみてください?それは非常に混乱しています。 –