-
Notifications
You must be signed in to change notification settings - Fork 362
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
feat: support array within array #1699
Conversation
@raymondfeng @bajtos please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I think this will not handle the case where the nested items need to be converted from plain data objects into model instances, but that can be fixed later. The change proposed here is a good incremental improvement.
Please get at least one or two more approvals before landing. I am not very familiar with juggler code base, I may have missed a problem that's not obvious.
Agreed. I am aware that there can be other conditions when the resulting object will be unexpected. Let's just focus on the reported bug at the moment. |
if (isClass(this.itemType)) { | ||
return new this.itemType(item); | ||
} else { | ||
if (Array.isArray(item)) return item; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to test if item instanceof List
to convert List
, which is a special array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case it is breaking some test cases. The data structure which elicited the bug is a very unlikely one. This PR takes care of that scenario without side effects.
I think we should land the PR and move on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Description
POST request body:
Currently stored as:
Will be stored as:
Related issues
strongloop/loopback#4132
Checklist
guide