ProtoRPC Message Class definition

时间:2016-10-20 18:56:39

标签: google-app-engine firebase-realtime-database google-cloud-endpoints protorpc

Im building a Cloud Endpoint for processing requests from a Firebase App. I want endpoint to recieve a Firebase database object like this:

{
"$uid": "1234",
"$idCot": "abc", 
"text": "TextHere"
}

So I create a Message class to handle this request:

MyRequest(messages.Message):
     uid = messages.StringField(1, required = True)
     idCot = messages.StringField(2, required = True) 
     text = messages.StringField(3, required = True)     

but I cant find a way to create a valid Message Class in ProtoRPC to define that object because the "$" in the field name that Firebase adds.

2 个答案:

答案 0 :(得分:0)

不幸的是,今天用ProtoRPC这是不可能的。端点Java框架确实支持这一点。

答案 1 :(得分:-1)

前面的答案引用了Endpoints Framework for Java,它是Endpoints v2版本的一部分。文档在这里:https://cloud.google.com/endpoints/docs/frameworks/java/