Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty arrays coming back as undefined #28

Open
dipunm opened this issue Dec 11, 2017 · 0 comments
Open

empty arrays coming back as undefined #28

dipunm opened this issue Dec 11, 2017 · 0 comments

Comments

@dipunm
Copy link
Collaborator

dipunm commented Dec 11, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant