Giter VIP home page Giter VIP logo

Comments (4)

niklasad1 avatar niklasad1 commented on September 4, 2024

Hey hey,

I'm interacting with a server that sends additional fields in the response message. The fields contain data I care about, so I can't even simply patch jsonrpsee to ignore them (right now jsonerpsee just asserts due to unknown field).

Sorry about that I changed the deserialization of the responses to a manual implementation but forgot about that, fixed in #1353

I'm down to make a PR, but I'd like to know if you could guide me through the most painless way to implement this?

Seems like the easiest way would be to extend Response/Notification/etc to have some kind of unknowns: Value, but that would mean dynamic allocations + requiring a feature flag, which is ugly.

What we could is to introduce another field other: HashMap<String, serde_json::value::RawValue> where it's possible for folks to access custom stuff but kind of annoying allocate stuff that may not be used. We were discussing to hide it behind a feature flag but I'm not sure I tend to be reluctant to add more feature flags because it's so tricky to maintain etc.

Thus, I think it's fine to add to another field other: HashMap<String, serde_json::value::RawValue> to the response type.

from jsonrpsee.

thebabush avatar thebabush commented on September 4, 2024

Thanks for replying.

Thus, I think it's fine to add to another field other: HashMap<String, serde_json::value::RawValue> to the response type.

Problem is RawValue is not sized. Would Value work?

Also, I want to get access to the fields, and process_single_response just returns the result. It doesn't seem too easy to change that.

from jsonrpsee.

niklasad1 avatar niklasad1 commented on September 4, 2024

Yeah, you could use either Box<RawValue> or serde_json::Value for that

from jsonrpsee.

thebabush avatar thebabush commented on September 4, 2024

Well, here it is: thebabush@84130ec

However, that hashmap is useless atm.

from jsonrpsee.

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.