Git Product home page Git Product logo

Comments (4)

keith avatar keith commented on August 25, 2024

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.

lxcid avatar lxcid commented on August 25, 2024

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.

keith avatar keith commented on August 25, 2024

@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.

lxcid avatar lxcid commented on August 25, 2024

I see! Sorry for the misunderstanding!

from mapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.