You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix so all added metadata is retained, unless a duplicate call is made which overwrites an existing namespace & key
Create a v2 suffixed function that can accept json, rather than a using having to make multiple calls. This pattern is used in the message metadata v2 functions, but I believe this was mainly done to accept matching rules in the integration json format but are not relevant for generic top level Pact file metadata
The text was updated successfully, but these errors were encountered:
I do think the current functions needs to be fixed. Adding to entries to a namespace should result in these two entries being in the namespace. This is a bug which I highly doubt anyone is relying on.
Now for accepting JSON, this really should be added. It can also fallack to handling the string as-is, namely:
Try and deserialise the value into a serde_json::Value:
2. If that succeeds, proceed with the given value in the code as before
3. If that fails, proceed with the original string as the value
This would be a breaking change to the current behaviour for strings which were handled as strings, but can be deserialized into a JSON value:
Input Str/Current
Fixed
"null"
null
"1"
1
r#"{"foo": "bar"}#
{"foo": "bar"}
Given this function is only for Pact metadata, I do wonder whether incorporating a breaking change into the current function is justified? Or we just be safe and create a _v2 function?
Writing a pact with the following metadata
Results in the following metadata.
namespace1
only has the last entry{"var_2": "value_2"}
, missing{"var_1": "value_1"}
namespace2
only has the last entry{"var_2": "value_2"}
, missing{"var_1": "value_1"}
pactRust
only has the last entry{"var_2": "value_2"}
, missing{"var_1": "value_1"}
, existingpactRust
entries not removed. (models
/mockserver
)Other notes.
pactSpecification
namespace appears to be protected and cannot write to itpactRust
library versions are not overwritten, so only newly added keys bar the latest are removed, in a single pact executionSource location for function
pact-reference/rust/pact_ffi/src/mock_server/handles.rs
Lines 1140 to 1152 in f5ddf3d
Should we do the following
The text was updated successfully, but these errors were encountered: