Return JSON field in GAE ProtoRPC

90 Views Asked by At

I want to construct an arbitrary json like this and return to the user dynamically

{
"items":[
    {
        "available":"2",
        "capacity":"2",
        "name":"name2",
        "entityKey":"dkfhakshdfh"
    },
    {
        "available":"1",
        "capacity":"1",
        "name":"name1",
        "entityKey":"dkfhaksdfef"
    }
],
"kind":"theatreManagement#show",
"etag":"\"asdfasdfasfasfahih\""w 
}

But there seems to be no fields to pass in the json. The fields available are like StringField, BytesField, etc.,

How to return a json object?

1

There are 1 best solutions below

0
Rose Davidson On

OpenAPI services such as those created by the Google Cloud Endpoints Framework need to specify exactly what they return. You should define a message containing fields like 'items', 'kind', 'etag', and so on.