Function pact_ffi::mock_server::handles::pactffi_given_with_params
source · #[no_mangle]
pub extern "C" fn pactffi_given_with_params(
interaction: InteractionHandle,
description: *const c_char,
params: *const c_char
) -> c_int
Expand description
Adds a provider state to the Interaction with a set of parameter key and value pairs in JSON
form. If the params is not an JSON object, it will add it as a single parameter with a value
key.
§Parameters
description
- The provider state description.params
- Parameter values as a JSON fragment.
§Errors
Returns EXIT_FAILURE (1) if the interaction or Pact can’t be modified (i.e. the mock server
for it has already started).
Returns 2 and sets the error message (which can be retrieved with pactffi_get_error_message
)
if the parameter values con’t be parsed as JSON.
Returns 3 if any of the C strings are not valid.