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

JSONDictionaryFromModel ignores model overrides of dictionaryValue #511

Closed
jgrandelli opened this issue May 5, 2015 · 2 comments
Closed
Labels

Comments

@jgrandelli
Copy link

Previous to 2.0, you could override dictionaryValue in your model and do things like drop keys with null values or arbitrarily drop keys not required for serialization. This is no longer the case with Mantle 2.0. The problem seems to be with this line NSDictionary *dictionaryValue = [model.dictionaryValue dictionaryWithValuesForKeys:propertyKeysToSerialize.allObjects]; in MTLJSONAdapter (line 189). From what I can tell it is possible to subclass MTLJSONAdapter and override serializablePropertyKeys: however this seems to be quite a bit of over head and effort to do things like drop nulls or model specific serialization logic.

@jspahrsummers
Copy link
Member

/cc @robb

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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