Conversation
The toJSON() is not working correctly right now. If you are interested in this feature then i can spend more time optimising it and include test cases. |
i'm not quite gathering the utility of this. what is not working about |
Value for key path increases the flexibility. If we have a JSON like below.
then we can skip the Location struct and use location in directory Address object using keyPath
This pull request is working fine in Deserialisation but not while converting back to JSON(). For example you can run the test case at https://github.com/RahulKatariya/Reactofire/blob/master/ReactofireTests/ReactofireTests.swift |
i see. does this work for nested models? e.g. i'd implement the example as below - does decoding still work? what about if i wanted a model with mixed properties - i.e. some are other i do appreciate the thought/work, but i'd not consider it unless it worked for
|
Hi Harlan, I have fixed the toJSON() method and have also added the test case which you can see at https://github.com/RahulKatariya/Gloss/blob/glossy-keypath/Sources/GlossTests/KeyPathTests.swift Best Regards, |
great - i'll have to spend some time playing with this myself this weekend; i'll respond back here if i encounter issues |
👍🏼 |
@RahulKatariya can you rebase this? conflicts with the latest |
@RahulKatariya i rebased and merged this into |
@hkellaway Sorry i was on weekend vacation. I have one more pull request to make which i think could be available in 0.7.0. There is some issue in modelsArrayFromJson. |
no prob. would it be possible to make that today? I have time to review What is the issue? |
I have opened the issue #106 . |
thanks @RahulKatariya |
I have not tested this much but this will allow us to use keyPaths when needed.