MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_json_minimal_has_null_optionals

Function test_json_minimal_has_null_optionals

atomic-agent/src/envelope.rs:978–990  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

976
977 #[test]
978 fn test_json_minimal_has_null_optionals() {
979 // With serde (no skip_serializing_if),
980 // None fields serialize as null in JSON and empty vecs as [].
981 let e = make_minimal_envelope();
982 let json = serde_json::to_string(&e).unwrap();
983 // Required fields are present
984 assert!(json.contains("session_id"));
985 assert!(json.contains("agent_name"));
986 assert!(json.contains("turn_number"));
987 // Optional fields are present as null
988 assert!(json.contains("total_turns"));
989 assert!(json.contains("delegation_id"));
990 }
991
992 #[test]
993 fn test_json_includes_present_fields() {

Callers

nothing calls this directly

Calls 2

make_minimal_envelopeFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected