@@ -80,7 +80,13 @@ extension type ReadResourceRequest.fromMap(Map<String, Object?> _value)
8080
8181 /// The URI of the resource to read. The URI can use any protocol; it is
8282 /// up to the server how to interpret it.
83- String get uri => _value['uri' ] as String ;
83+ String get uri {
84+ final uri = _value['uri' ] as String ? ;
85+ if (uri == null ) {
86+ throw ArgumentError ('Missing uri field in $ReadResourceRequest .' );
87+ }
88+ return uri;
89+ }
8490}
8591
8692/// The server's response to a resources/read request from the client.
@@ -128,7 +134,13 @@ extension type SubscribeRequest.fromMap(Map<String, Object?> _value)
128134
129135 /// The URI of the resource to subscribe to. The URI can use any protocol;
130136 /// it is up to the server how to interpret it.
131- String get uri => _value['uri' ] as String ;
137+ String get uri {
138+ final uri = _value['uri' ] as String ? ;
139+ if (uri == null ) {
140+ throw ArgumentError ('Missing uri field in $SubscribeRequest .' );
141+ }
142+ return uri;
143+ }
132144}
133145
134146/// Sent from the client to request cancellation of resources/updated
@@ -146,7 +158,13 @@ extension type UnsubscribeRequest.fromMap(Map<String, Object?> _value)
146158 UnsubscribeRequest .fromMap ({'uri' : uri, if (meta != null ) '_meta' : meta});
147159
148160 /// The URI of the resource to unsubscribe from.
149- String get uri => _value['uri' ] as String ;
161+ String get uri {
162+ final uri = _value['uri' ] as String ? ;
163+ if (uri == null ) {
164+ throw ArgumentError ('Missing uri field in $UnsubscribeRequest .' );
165+ }
166+ return uri;
167+ }
150168}
151169
152170/// A notification from the server to the client, informing it that a resource
0 commit comments