Giter Club home page Giter Club logo

Comments (5)

swankjesse avatar swankjesse commented on August 23, 2024

It should be a standalone thing!

from moshi.

swankjesse avatar swankjesse commented on August 23, 2024

(Neat though!)

from moshi.

sddamico avatar sddamico commented on August 23, 2024

@ryankennedyio if you're looking for something that might work better out of the box, I've used json-patch before in a similar application.

https://github.com/fge/json-patch

from moshi.

ryankennedyio avatar ryankennedyio commented on August 23, 2024

@sddamico Thanks, I have had that in mind for quite a while. Will bring up with the rest of the team, but they keypath encoding is nice because it's very compact (it's a system which needs to deal with pretty massive traffic spikes, so as few characters as possible for the network's sake is nice).

Thanks @swankjesse. After reading the initial docs from today, I was less hopeful about this magic bullet. I was hoping never to deal with org.JSONObject again :)

Could fork and have a go at implementing - but as you said, I don't think it's in line with the idea of this library.

from moshi.

swankjesse avatar swankjesse commented on August 23, 2024

Yup. You might experiment with TypeAdapters by adding APIs like this:

  public Object get(JsonPath path);
  public void set(JsonPath path, Object value);

For example, the map adapter would use the first segment of the path as its key, and then make a recursive call on that entry's value.

from moshi.

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.