pub trait JsonRpcParamswhere
    Self: Sized + Debug + Serialize,
{ type Container<T>: Debug + Serialize; type Response: Debug + DeserializeOwned; fn build(self) -> JsonRpcRequest<Self>; }
Expand description

Implemented by Odoo “method” types (e.g., Execute or SessionAuthenticate)

When building an JsonRpcRequest object, the params field is actually set to JsonRpcParams::Container, not the concrete “method” type. This allows for flexibility in the Serialize impl.

For example, the Execute method uses OdooApiContainer as its container, which injects the service and method keys into the request struct:

{
    "jsonrpc": "2.0",
    "method": "call",
    "id": 1000,
    "params": {
        "service": "object",
        "method": "execute",
        "args": <Execute is serialized here>
    }
}

Whereas the SessionAuthenticate method’s container (OdooWebContainer) has a transparent Serialize impl, so the SessionAuthenticate data is set directly on the params key:

{
    "jsonrpc": "2.0",
    "method": "call",
    "id": 1000,
    "params": <SessionAuthenticate is serialized here>
}

Required Associated Types§

Required Methods§

Implementors§