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

How to serialize back to JSON only some properties of a NSManaged object. #8

Closed
kikolobo opened this issue Dec 7, 2014 · 4 comments
Labels

Comments

@kikolobo
Copy link

kikolobo commented Dec 7, 2014

Hi,

Is there a way for Groot to serialize back to JSON Dictionary only some properties of my NSManaged Object?

Also, I want to know if it's possible to serialize from JSON some properties and to not serial back to JSON all of those properties. For example the createdAt time stamp that is created by the server.

@gonzalezreal
Copy link
Owner

If JSONKeyPath is associated with @"null" or NSNull then the attribute or relationship will not participate in JSON serialization.

@kikolobo
Copy link
Author

kikolobo commented Dec 7, 2014

What about if I want to serialize in one direction and not to another.

Say from JSON to manage object and NOT from manage object to JSON?

@gonzalezreal
Copy link
Owner

There's no way to do that at the moment. You'll need to remove the keys manually.

@gonzalezreal
Copy link
Owner

In Groot 1.0, attributes and relationships that don't have a JSONKeyPath entry are not considered for JSON serialization or deserialization.

This should solve your issue when serializing back to JSON.

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

No branches or pull requests

2 participants