如何在谷歌端点使用protobuf

时间:2021-08-20 23:14:29

I'm writing Google Endpoints application and I want to return protobuf object in my @Api class.

我正在编写Google Endpoints应用程序,我想在@Api类中返回protobuf对象。

All the time I'm getting this error:

我一直收到这个错误:

Error:Gradle: Execution failed for task ':ExploreBackend:appengineEndpointsGetClientLibs'. There was an error running endpoints command get-client-lib: Object type ? extends xxx.model.proto.MainProtos$PlaceOrBuilder not supported.

错误:Gradle:任务执行失败':ExploreBackend:appengineEndpointsGetClientLibs'。运行端点命令时出错了get-client-lib:对象类型?扩展xxx.model.proto.MainProtos $ PlaceOrBuilder不受支持。

This is my code:

这是我的代码:

@Api( ... )
public class CityApi {

    public List<MainProto.City> getCities() {
        return new ArrayList<MainProto.City>();
    }
}

1 个解决方案

#1


2  

How to use protobuf in google endpoints

如何在谷歌端点使用protobuf

You can not

你不能

#1


2  

How to use protobuf in google endpoints

如何在谷歌端点使用protobuf

You can not

你不能