Comments (4)
Right now we don't have any plans for JSON serialization.
The biggest issue is we haven't been able to come up with a way to do this without duplicating the mapping created in the initializer, and I'm not sure we will be able to keeping the current interface.
It seems like ObjectMapper (and a few other libraries) handle this by doing some tricky stuff with the operators and subscripts, which works well (our old mapper did this as well). But since we're using an initializer where we are forced to use =
we don't really have that flexibility.
If you have any implementation ideas for how this would work we're definitely open to suggestions though!
from mapper.
Isn't JSON serialisation done by NSJSONSerializer
?
If you receive a NSDictionary
, you can pass it to the mapper.
I think keeping the mapper as it is now is perfect. DOTADIW.
I actually like how this doesn't try to introduce any new operator, rely on dependency injection, use new error handling, make great use of protocol and generic and Swift inference to get things done.
Great work!
from mapper.
@lxcid thanks for the kind words! Though I believe what @ldiqual was asking for here was a way to go from Model Objects -> NSDictionary
so that you could take the produced NSDictionary
and pass it to NSJSONSerialization
as needed. The Model Objects -> NSDictionary
portion is what might make sense for Mapper, but not something we're planning on just yet. Closing this issue for now, but we're still open to great ideas if anyone has them!
from mapper.
I see! Sorry for the misunderstanding!
from mapper.
Related Issues (20)
- Map root array into Models HOT 2
- Offer subspec without default convertible implementations HOT 2
- Issues when using firebase HOT 3
- Realm with Mapper HOT 5
- Suggestion for parsing one object from keyA or keyB? HOT 1
- Suggestion: Deserialization can handle wrong format in JSON HOT 2
- New patch version. HOT 2
- Question: Mapping Array of models fails entirely if mapping of one model fails HOT 2
- Array within array parsing HOT 4
- Module compiled with Swift 4.1.2 cannot be imported in Swift 4.1.50: Xcode 10 Error HOT 4
- using Mapper with Disk HOT 4
- Argument labels do not match HOT 3
- Module compiled with Swift 4.1.2 cannot be imported in Swift 4.1.50: Xcode 10 Error HOT 1
- Is this still good approach since Swift now has Decodable? HOT 1
- How to handle keys with "." HOT 3
- Mapper adding quotes around values HOT 1
- How to handle Date HOT 2
- Map object with inheritance HOT 1
- Destination mode needs lever limits HOT 1
- Cannot build for iOS Simulator on Apple Silicon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapper.