From a8b1d51c2591640e83137128a3d088593b7c4f3d Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Wed, 17 Jul 2024 13:14:04 +1000 Subject: [PATCH] chore(ffi): deprecate `pactffi_with_binary_file` The `pactffi_with_binary_file` is functionally replaced by the combination of `pactffi_with_binary_body` and `pactffi_with_matching_ruless`. These two functions should be preferred over this one. Furthermore, this function's naming (especially when compared to `pactffi_with_binary_body`) which might suggest it merely sets the body by reading a specific binary file. Signed-off-by: JP-Ellis --- rust/pact_ffi/src/mock_server/handles.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rust/pact_ffi/src/mock_server/handles.rs b/rust/pact_ffi/src/mock_server/handles.rs index 4c27c1d9..8eacabf2 100644 --- a/rust/pact_ffi/src/mock_server/handles.rs +++ b/rust/pact_ffi/src/mock_server/handles.rs @@ -1926,6 +1926,14 @@ pub extern fn pactffi_with_binary_body( }).unwrap_or(false) } +///
+/// +/// This function is deprecated. Use [`pactffi_with_binary_body`] in order to +/// set the binary body, and use [`pactffi_with_matching_rules`] to set the +/// matching rules to ensure that only the content type is being matched. +/// +///
+/// /// Adds a binary file as the body with the expected content type and example contents. Will use /// a mime type matcher to match the body. Returns false if the interaction or Pact can't be /// modified (i.e. the mock server for it has already started) @@ -1952,6 +1960,7 @@ pub extern fn pactffi_with_binary_body( /// Returns false if the interaction or Pact can't be modified (i.e. the mock server for it has /// already started) or an error has occurred. #[no_mangle] +#[deprecated(note = "Use `pactffi_with_binary_body` and `pactffi_with_matching_rules` instead")] pub extern fn pactffi_with_binary_file( interaction: InteractionHandle, part: InteractionPart,