Skip to main content

Module validation

Module validation 

Source
Expand description

JSON-RPC 2.0 request validator.

Separates transport-level parse/validate failures (which produce -32700/-32600 responses with id: null) from method-level dispatch errors (-32601/-32602/daemon-specific codes).

The validator operates on serde_json::Value so the batch router can parse the top-level array/object split once and pass individual elements through here. See [super::router] for the batch flow.

Enums§

ValidationError
Transport-level validation failure.

Functions§

parse_error_response
Build the top-level parse-error response for a frame whose bytes could not be decoded as JSON.
validate_request_value
Validate a single request Value and convert it into a typed JsonRpcRequest. The caller is responsible for the outer batch-vs-single split and for producing the top-level parse-error response on failing serde_json::from_slice.