-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
toJSON() not working for level 3 inclusions #1401
Comments
Serialization calls .toJSON() recursively as part of JSON.stringify(). There seems to be an issue that in the toJSON() implementation which doesn't go into the 3rd level. We'll investigate. |
It seems to be a user error:
|
Ah, that was a typo :( I'll make a test spec to reproduce the issue. |
This mocha test reproduces the issue;
|
@erikverheij thanks for the test case :) |
* Enhance the apis and add more tests (Raymond Feng) * Fix for strongloop/loopback#1401 (Raymond Feng) * Fix ReferenceError: definition is not defined (Dmitry Manannikov) * Mix in observer apis to the connector (Raymond Feng) * Enhance fieldsToArray to consider strict mode (Raymond Feng)
@raymondfeng Can I close this? |
The issue should have been fixed by loopbackio/loopback-datasource-juggler#600. Please open a new issue if the problem still persists. |
I'm using the toJSON() method so I can apply lodash methods like _.omit() on the data. In can only get it working until the second inclusion level.
When
challengers
is returned as HTTP response body the data is returned as expected. Is loopback using a different method than .toJSON() to serialize the data returned to the client?The text was updated successfully, but these errors were encountered: