Skip to main content

build_request_json

Function build_request_json 

Source
pub fn build_request_json(
    input: &MessageDescriptor,
    body_mapping: &BodyMapping,
    body_json: Value,
    path_params: &HashMap<String, String>,
    query: &[(String, String)],
) -> Result<Value, String>
Expand description

Build the request-message JSON from the body mapping, path params, and query.

Path-bound fields win over the body, and the body wins over query parameters (query only fills fields not already set). Unknown query keys are dropped rather than rejected, matching common transcoder behavior.

§Errors

Returns an error string if body maps to the message root but the parsed body is not a JSON object.