MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / provider_to_json_omits_empty_config

Function provider_to_json_omits_empty_config

crates/openshell-cli/src/run.rs:9575–9590  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9573
9574 #[test]
9575 fn provider_to_json_omits_empty_config() {
9576 let provider = Provider {
9577 metadata: Some(ObjectMeta::default()),
9578 r#type: "anthropic".to_string(),
9579 credentials: std::collections::HashMap::new(),
9580 config: std::collections::HashMap::new(), // Empty config
9581 credential_expires_at_ms: std::collections::HashMap::new(),
9582 };
9583
9584 let json = super::provider_to_json(&provider);
9585
9586 assert!(
9587 json.get("config_keys").is_none(),
9588 "empty config_keys should be omitted"
9589 );
9590 }
9591
9592 #[test]
9593 fn provider_to_json_includes_metadata_fields_when_present() {

Callers

nothing calls this directly

Calls 1

provider_to_jsonFunction · 0.85

Tested by

no test coverage detected