When I use Cloud Endpoints to return an ArrayList I get a named array (“items”) inside an object. (Each Koko is identified by “kokoId”.):
{
"items": [
{
"kokoId": "63ebb313-251d-40ad-bc0e-9693489b6a85",
"kokoName": "klambake",
"latitude": 457.0,
"longitude": 22.0,
"tags": [
"d",
"e",
"f"
],
"media": [
{
"kokoMedia_id": 9,
"createdOn": "2020-11-30T09:49:58.515",
"fileType": ".wav",
"displayName": "klerf"
},
{
"kokoMedia_id": 10,
"createdOn": "2020-11-30T09:49:58.515",
"fileType": ".jpg",
"displayName": "smerf"
},
{
"kokoMedia_id": 11,
"createdOn": "2020-11-30T09:49:58.515",
"fileType": ".jpeg",
"displayName": "derf"
}
],
"createdOn": "2020-12-03T09:49:58.515",
"description": "yee haw!",
"locationProvenance": "LAST_KNOWN",
"version": 1
},
{
"kokoId": "0b1f17e8-8af1-4144-872f-3bc3fae691ad",
"kokoName": "Oh dot of mine.",
"latitude": 456.0,
. . .
This behavior appears to be the same as was described in:
Return JSON array as response using Google Cloud Endpoints Framework in Python
but I am using Java as opposed to Python and I am not using Protocol Buffers.
The library that will process the return value (Flutter Data) cannot use the paginated Collection type offered as part of the Cloud Endpoints framework AFAIK.
Is anyone aware of a way to return an unadorned JSON array of objects?
Thanks.