You should be passing around Java Beans as your argument and return types. This will work:
class Response {
private Double d;
// getter and setter
}
@ApiMethod(name = "weather.bla")
public Response Bla()
{
Response r = new Response();
r.setD(2.5)
return r;
}
The exception to this is query parameters (as arguments to an API method). If annotate an argument with the @Named
annotation, it no longer needs to be a Java Bean (you can use Double
, String
, Long
, etc.) For example:
@ApiMethod(name = "weather.bla")
public Response Bla(@Named("d") Double d)
{
Response r = new Response();
r.setD(d)
return r;
}