use tap_msg::message::connection::Connect;
fn main() {
let connect = Connect::new(
"test-transaction-123",
"did:example:agent1",
"did:example:principal",
Some("originator"),
);
let json = serde_json::to_string_pretty(&connect).unwrap();
println!("Connect message serialized to JSON:");
println!("{}", json);
let json_value: serde_json::Value = serde_json::from_str(&json).unwrap();
if json_value.get("transaction_id").is_some() {
println!("\n✗ transaction_id IS present in the JSON (it should not be)");
} else {
println!("\n✓ transaction_id is NOT present in the JSON (as expected)");
}
println!("\nFields present in JSON:");
if let Some(obj) = json_value.as_object() {
for key in obj.keys() {
println!(" - {}", key);
}
}
}