Comments (4)
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.
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.
Yeah, you could use either Box<RawValue> or serde_json::Value
for that
from jsonrpsee.
Well, here it is: thebabush@84130ec
However, that hashmap is useless atm.
from jsonrpsee.
Related Issues (20)
- Tracking WS/Http specific request metrics HOT 2
- [Feature Rqeuest]: Generate documentation from traits declarations and attrs of `#[rpc]` macro HOT 2
- client: `max_buffer_capacity_per_subscription` doesn't check that n == 0 HOT 2
- Can't use `params` as parameter name when using `subscription` proc-macro attribute HOT 5
- Strange behaviour when sending a web socket request. HOT 6
- Pass something from http middleware to rpc middleware HOT 4
- Username and password in the url ignored HOT 1
- Use async backpressure instead of MaxSlotsExceeded error HOT 1
- support RequestID as `null` HOT 1
- server: wrapping `jsonrpsee:TowerService` is a new type pattern is not possible
- Inheriting HTTP Header Option to RPC middlewares HOT 2
- server: `http extensions` are cloned for every rpc call
- Helper function for hyper v1 graceful shutdown HOT 1
- `0.23.0` `tls` feature relies on `rustls-platform-verifier`, bringing other unwanted dependencies HOT 4
- Failed response decoding breaks RPC connection HOT 10
- bug(transport): it should not try to resolve sockaddrs when using `build_with_stream` HOT 2
- HTTP level request response Logging HOT 2
- Websocket: How to map a new connection request followed by json rpc request HOT 7
- Is there a way to close the subscription from the server? HOT 4
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 jsonrpsee.