Skip to content

empty arrays coming back as undefined #28

Open
@dipunm

Description

@dipunm

Since the GetData method translates JSON to key-value pairs when posting to the OC server, it seems that there are some details missing.

an object such as:

{ people: [], animals: ['cat', 'dog'] .... }

is translated to something like:

data.animals[] = 'cat'
data.animals[] = 'dog'

Notice that there are no entries for people because there are no values in that array.
When serialised back to JSON, the people property is undefined. This can be handled by the client, but it is not an ideal side effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions