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
Use of camelCased properties importing from JSON #1063
Comments
Hi Michal I believe you need to have to exact names in your model and JSON response to map them with the |
Here is a library that someone in the community made that does just this https://github.com/matthewcheok/Realm-JSON We are working on something similar in the near future |
Another option for those in need, ObjectMapper which is Mantle-like in that it allows serialization to and from JSON and has property transformers, but perhaps a bit more lean. |
Incase someone else comes across this, another person had issues using ObjectMapper #1726 |
Closing as duplicate of #694 |
My model in Swift has property named
isPromo
.In JSON, this property is named
is_promo
and this throws an exception when importing withcreateInDefaultRealmWithObject
Is there some way how to import this without changing the JSON dictionary?
It would be nice to have some function in model where we could define this transforms. Also if we have different property names in models.
For example something like this:
The text was updated successfully, but these errors were encountered: