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

Odd behavior with payload object with length attribute in Normalize Serializer Payload #3387

Closed
kalebdf opened this issue Jun 18, 2015 · 1 comment

Comments

@kalebdf
Copy link

kalebdf commented Jun 18, 2015

Current Behavior

The array check (using Ember.isArray) in the SerializeResponse _normalizeSerializerPayload returns true for a payload object ([object Object]) with a length data attribute. This yielded a data object with several attributes with undefined as the value.

Ember: 1.13.2 & Ember Data: 1.13.2

Expected Behavior

A payload object with length data attribute should NOT be evaluated as an Array and go through the true block.

cc/ @bmac


The JSON API we were using returned a resource with several attributes one of which was length.

{
    "id": 123,
    "width": 10,
    "length": 15
}

Note: Don't use length or any possible reserved keywords in your API. We have changed our API to now return size_length vs. length. It goes along the same line as using lng vs. long for longitude.

@kalebdf kalebdf changed the title Payload object with length attribute Normalize Serializer Payload Odd behavior with payload object with length attribute in Normalize Serializer Payload Jun 18, 2015
@wecc
Copy link
Contributor

wecc commented Jun 29, 2015

Fixed by #3397.

@wecc wecc closed this as completed Jun 29, 2015
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

2 participants