feat: add "theme" to Icon (#766)

* feat: add theme field to Icon

* fix: update IconThem crates/rmcp/src/model.rs (non_exhaustive)

Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>

* fix: update IconThem crates/rmcp/src/model.rs (eq, hash)

Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>

* fix: update docs with full descriptions of theme from mcp spec

---------

Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
This commit is contained in:
Guy Lichtman 2026-03-26 16:26:44 +02:00 • committed by GitHub
commit 0b36a84f05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -217,6 +217,7 @@ mod tests {
use serde_json;
use super::*;
use crate::model::IconTheme;
#[test]
fn test_resource_serialization() {
@ -268,6 +269,7 @@ mod tests {
src: "https://example.com/icon.png".to_string(),
mime_type: Some("image/png".to_string()),
sizes: Some(vec!["48x48".to_string()]),
theme: Some(IconTheme::Light),
}]),
};
@ -275,6 +277,7 @@ mod tests {
assert!(json["icons"].is_array());
assert_eq!(json["icons"][0]["src"], "https://example.com/icon.png");
assert_eq!(json["icons"][0]["sizes"][0], "48x48");
assert_eq!(json["icons"][0]["theme"], "light");
}
#[test]