ProtoRPC Message Class definition

80 Views Asked by At

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

There are 2 best solutions below

0
saiyr On

Unfortunately, this just isn't possible with ProtoRPC today. The Endpoints Java framework does support this though.

1
Jason On

The previous answer refers to the Endpoints Framework for Java, which is part of the Endpoints v2 release. Documentation is here: https://cloud.google.com/endpoints/docs/frameworks/java/