stephanenicolas / robospice

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k stars 545 forks source link

Can not parse json with "_id" field #363

Closed PohilAlex closed 10 years ago

PohilAlex commented 10 years ago

Hey, I try parse simple POJO in GoogleHttpClientSpiceRequest

public class City { @Key(value="_id") String id; @Key(value="name") String name; }

request.setParser(new GsonFactory().createJsonObjectParser()); request.execute().parseAs(getResultType());

But I catch exeption: java.lang.IllegalArgumentException: key _id If I try parse only name field all works well. I use reobospice v1.4.13

rciovati commented 10 years ago

It should be:

@Key("_id")
String id;

BTW this is related to Google HTTP Client, not Robospice.