1- using System . ComponentModel . DataAnnotations ;
21using System . Text . Json . Serialization ;
32
43namespace A2A ;
@@ -18,7 +17,7 @@ public class AgentCard
1817 /// Gets or sets the human readable name of the agent.
1918 /// </summary>
2019 [ JsonPropertyName ( "name" ) ]
21- [ Required ]
20+ [ JsonRequired ]
2221 public string Name { get ; set ; } = string . Empty ;
2322
2423 /// <summary>
@@ -30,8 +29,8 @@ public class AgentCard
3029 /// (e.g., "This agent helps users find recipes, plan meals, and get cooking instructions.")
3130 /// </remarks>
3231 [ JsonPropertyName ( "description" ) ]
33- [ Required ]
34- public string ? Description { get ; set ; }
32+ [ JsonRequired ]
33+ public string Description { get ; set ; } = string . Empty ;
3534
3635 /// <summary>
3736 /// Gets or sets a URL to the address the agent is hosted at.
@@ -40,7 +39,7 @@ public class AgentCard
4039 /// This represents the preferred endpoint as declared by the agent.
4140 /// </remarks>
4241 [ JsonPropertyName ( "url" ) ]
43- [ Required ]
42+ [ JsonRequired ]
4443 public string Url { get ; set ; } = string . Empty ;
4544
4645 /// <summary>
@@ -53,14 +52,14 @@ public class AgentCard
5352 /// Gets or sets the version of the agent - format is up to the provider.
5453 /// </summary>
5554 [ JsonPropertyName ( "version" ) ]
56- [ Required ]
55+ [ JsonRequired ]
5756 public string Version { get ; set ; } = string . Empty ;
5857
5958 /// <summary>
6059 /// The version of the A2A protocol this agent supports.
6160 /// </summary>
6261 [ JsonPropertyName ( "protocolVersion" ) ]
63- [ Required ]
62+ [ JsonRequired ]
6463 public string ProtocolVersion { get ; set ; } = "0.2.3" ;
6564
6665 /// <summary>
@@ -73,7 +72,7 @@ public class AgentCard
7372 /// Gets or sets the optional capabilities supported by the agent.
7473 /// </summary>
7574 [ JsonPropertyName ( "capabilities" ) ]
76- [ Required ]
75+ [ JsonRequired ]
7776 public AgentCapabilities Capabilities { get ; set ; } = new AgentCapabilities ( ) ;
7877
7978 /// <summary>
@@ -95,19 +94,21 @@ public class AgentCard
9594 /// This can be overridden per-skill. Supported media types for input.
9695 /// </remarks>
9796 [ JsonPropertyName ( "defaultInputModes" ) ]
97+ [ JsonRequired ]
9898 public List < string > DefaultInputModes { get ; set ; } = [ "text" ] ;
9999
100100 /// <summary>
101101 /// Gets or sets the supported media types for output.
102102 /// </summary>
103103 [ JsonPropertyName ( "defaultOutputModes" ) ]
104+ [ JsonRequired ]
104105 public List < string > DefaultOutputModes { get ; set ; } = [ "text" ] ;
105106
106107 /// <summary>
107108 /// Gets or sets the skills that are a unit of capability that an agent can perform.
108109 /// </summary>
109110 [ JsonPropertyName ( "skills" ) ]
110- [ Required ]
111+ [ JsonRequired ]
111112 public List < AgentSkill > Skills { get ; set ; } = [ ] ;
112113
113114 /// <summary>
0 commit comments