0
我有以下云端点:谷歌云端点对象永远不能为null
@ApiMethod(name = "test.insert")
public Test insertTest(final Test test)
{
// test is Test here, but not null
}
我传递null作为Android客户端上的参数:
api.test().insert(null).execute();
在后端,将创建一个测试对象,所有字段都为空。但对象本身不是null。
- 如何测试对象为null或防止null传入API?
我知道我可以使@Name参数@Nullable,但对于对象参数,它看起来像GCE或REST不会按预期重新构造空对象。