Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23376] ArrowDB - Documentation improvement

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterClément Blanco
AssigneeUnknown
Created2016-05-13T12:50:51.000+0000
Updated2018-02-28T19:54:59.000+0000

Description

I couldn't understand why I wasn't getting the photo associated to my Custom Object created. The API was always returning photo: {} which is an empty object. Figured it out that when you use any query like Cloud.Objects.query() by default response_json_depth set to 1 and even if I had a Photos object linked to my Custom Object, the API was returning:
{
    "Vehicle": [
        {
            "name": "foo",
            "photo: {}
        }
    ]
}
by setting response_json_depth to 3 I managed to have:
{
    "Vehicle": [
        {
            "name": "foo",
            "photo: {
                "urls": {
                    "original": "http://bar.com"
                }
            }
        }
    ]
}
so that’s one mystery solved but I think maybe a warning message into the documentation to point people into that direction when checking the photo attribute on the Custom Object for example would help. Maybe something around those lines: {quote} Warning: if you are trying to fetch attributes which should have child objects like photo, be aware that you'll need to increase response_json_depth otherwise photo attribute will always return an empty Object. {quote}

Comments

  1. Sharif AbuDarda 2016-05-13

    Hello, Thanks for creating the ticket. Our engineers will look into it. Please provide the docs link where this should be documented. Moving the ticket. Regards, Sharif.
  2. Clément Blanco 2016-05-13

    Well not sure... everywhere there is the ability to retrieve a multi level JSON object as a response from the API I would say. Or every time you mention a relationship to a another object...

JSON Source