#[no_mangle]
pub extern "C" fn pactffi_message_with_metadata_v2(
    message_handle: MessageHandle,
    key: *const c_char,
    value: *const c_char
)
Expand description

Adds expected metadata to the Message

  • key - metadata key
  • value - metadata value, supports JSON structures with matchers and generators

To include matching rules for the value, include the matching rule JSON format with the value as a single JSON document. I.e.

const char* value = "{\"value\": { \"ID\": \"sjhdjkshsdjh\", \"weight\": 100.5 }, \"pact:matcher:type\":\"type\"}";
pactffi_message_with_metadata_v2(handle, "TagData", value);

See IntegrationJson.md

§Safety

The key and value parameters must be valid pointers to NULL terminated strings.