File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed 
src/ModelContextProtocol/Protocol/Types Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 1+ using  System . Text . Json . Serialization ; 
2+ 
3+ namespace  ModelContextProtocol . Protocol . Types ; 
4+ 
5+ /// <summary> 
6+ /// Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed. 
7+ /// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see> 
8+ /// </summary> 
9+ public  abstract  record  Annotated 
10+ { 
11+     /// <summary> 
12+     /// Optional annotations for the resource. 
13+     /// </summary> 
14+     [ JsonPropertyName ( "annotations" ) ] 
15+     public  Annotations ?  Annotations  {  get ;  init ;  } 
16+ } 
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types;
66/// Represents a known resource that the server is capable of reading. 
77/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see> 
88/// </summary> 
9- public  record  Resource 
9+ public  record  Resource   :   Annotated 
1010{ 
1111    /// <summary> 
1212    /// The URI of this resource. 
@@ -31,10 +31,4 @@ public record Resource
3131    /// </summary> 
3232    [ JsonPropertyName ( "mimeType" ) ] 
3333    public  string ?  MimeType  {  get ;  init ;  } 
34- 
35-     /// <summary> 
36-     /// Optional annotations for the resource. 
37-     /// </summary> 
38-     [ JsonPropertyName ( "annotations" ) ] 
39-     public  Annotations ?  Annotations  {  get ;  init ;  } 
4034} 
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace ModelContextProtocol.Protocol.Types;
88/// Represents a known resource template that the server is capable of reading. 
99/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see> 
1010/// </summary> 
11- public  record  ResourceTemplate 
11+ public  record  ResourceTemplate   :   Annotated 
1212{ 
1313    /// <summary> 
1414    /// The URI template (according to RFC 6570) that can be used to construct resource URIs. 
@@ -33,10 +33,4 @@ public record ResourceTemplate
3333    /// </summary> 
3434    [ JsonPropertyName ( "mimeType" ) ] 
3535    public  string ?  MimeType  {  get ;  init ;  } 
36- 
37-     /// <summary> 
38-     /// Optional annotations for the resource template. 
39-     /// </summary> 
40-     [ JsonPropertyName ( "annotations" ) ] 
41-     public  Annotations ?  Annotations  {  get ;  init ;  } 
4236} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments