Calling the function this way:
let json_ct = CString::new("application/vnd.schemaregistry.v1+json").unwrap(); let json = "{\"test\":true}"; let body = CString::new(json).unwrap(); let result = pactffi_with_body(i_handle, InteractionPart::Request, json_ct.as_ptr(), body.as_ptr());
we should expect to have the interaction1.request.body.content_type() == "application/vnd.schemaregistry.v1+json"
but it sets the default value instead.
it is done in the function pactffi_with_body exactly here:
let body = if reqres.request.content_type().unwrap_or_default().is_json() { let category = reqres.request.matching_rules.add_category("body"); OptionalBody::Present(Bytes::from(process_json(body.to_string(), category, &mut reqres.request.generators)), Some(JSON.clone()), None) }
Calling the function this way:
let json_ct = CString::new("application/vnd.schemaregistry.v1+json").unwrap(); let json = "{\"test\":true}"; let body = CString::new(json).unwrap(); let result = pactffi_with_body(i_handle, InteractionPart::Request, json_ct.as_ptr(), body.as_ptr());
we should expect to have the
interaction1.request.body.content_type() == "application/vnd.schemaregistry.v1+json"
but it sets the default value instead. it is done in the functionpactffi_with_body
exactly here:let body = if reqres.request.content_type().unwrap_or_default().is_json() { let category = reqres.request.matching_rules.add_category("body"); OptionalBody::Present(Bytes::from(process_json(body.to_string(), category, &mut reqres.request.generators)), Some(JSON.clone()), None) }