Skip to content

Commit

Permalink
chore: Update doc comment with NULL query parameter value example
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Apr 22, 2024
1 parent 4e1fca9 commit 941560b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion rust/pact_ffi/src/mock_server/handles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,21 @@ pub extern fn pactffi_with_query_parameter(
/// pactffi_with_query_parameter_v2(handle, "id", 0, value);
/// ```
///
/// For a query parameter with no value, the value parameter can be set to a NULL pointer.
/// For query parameters with no value, two distinct formats are provided:
///
/// 1. Parameters with blank values, as specified by `?foo=&bar=`, require an empty string:
///
/// ```c
/// pactffi_with_query_parameter_v2(handle, "foo", 0, "");
/// pactffi_with_query_parameter_v2(handle, "bar", 0, "");
/// ```
///
/// 2. Parameters with no associated value, as specified by `?foo&bar`, require a NULL pointer:
///
/// ```c
/// pactffi_with_query_parameter_v2(handle, "foo", 0, NULL);
/// pactffi_with_query_parameter_v2(handle, "bar", 0, NULL);
/// ```
///
/// # Safety
/// The name parameter must be a valid pointer to a NULL terminated string. If the value
Expand Down

0 comments on commit 941560b

Please sign in to comment.