@@ -123,11 +123,12 @@ public struct Request<M: Method>: Hashable, Identifiable, Codable, Sendable {
123123 try container. encode ( id, forKey: . id)
124124 try container. encode ( method, forKey: . method)
125125 try container. encode ( params, forKey: . params)
126-
126+
127127 // Encode _meta and extra fields, excluding JSON-RPC protocol fields
128128 var dynamicContainer = encoder. container ( keyedBy: DynamicCodingKey . self)
129129 try encodeMeta ( _meta, to: & dynamicContainer)
130- try encodeExtraFields ( extraFields, to: & dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
130+ try encodeExtraFields (
131+ extraFields, to: & dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
131132 }
132133}
133134
@@ -172,7 +173,8 @@ extension Request {
172173
173174 let dynamicContainer = try decoder. container ( keyedBy: DynamicCodingKey . self)
174175 _meta = try decodeMeta ( from: dynamicContainer)
175- extraFields = try decodeExtraFields ( from: dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
176+ extraFields = try decodeExtraFields (
177+ from: dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
176178 }
177179}
178180
@@ -254,17 +256,17 @@ public struct Response<M: Method>: Hashable, Identifiable, Codable, Sendable {
254256 }
255257
256258 public init (
257- id: ID ,
258- result: M . Result ,
259+ id: ID ,
260+ result: M . Result ,
259261 _meta: [ String : Value ] ? = nil ,
260262 extraFields: [ String : Value ] ? = nil
261263 ) {
262264 self . init ( id: id, result: . success( result) , _meta: _meta, extraFields: extraFields)
263265 }
264266
265267 public init (
266- id: ID ,
267- error: MCPError ,
268+ id: ID ,
269+ error: MCPError ,
268270 _meta: [ String : Value ] ? = nil ,
269271 extraFields: [ String : Value ] ? = nil
270272 ) {
@@ -285,11 +287,12 @@ public struct Response<M: Method>: Hashable, Identifiable, Codable, Sendable {
285287 case . failure( let error) :
286288 try container. encode ( error, forKey: . error)
287289 }
288-
290+
289291 // Encode _meta and extra fields, excluding JSON-RPC protocol fields
290292 var dynamicContainer = encoder. container ( keyedBy: DynamicCodingKey . self)
291293 try encodeMeta ( _meta, to: & dynamicContainer)
292- try encodeExtraFields ( extraFields, to: & dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
294+ try encodeExtraFields (
295+ extraFields, to: & dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
293296 }
294297
295298 public init ( from decoder: Decoder ) throws {
@@ -313,7 +316,8 @@ public struct Response<M: Method>: Hashable, Identifiable, Codable, Sendable {
313316
314317 let dynamicContainer = try decoder. container ( keyedBy: DynamicCodingKey . self)
315318 _meta = try decodeMeta ( from: dynamicContainer)
316- extraFields = try decodeExtraFields ( from: dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
319+ extraFields = try decodeExtraFields (
320+ from: dynamicContainer, excluding: Set ( CodingKeys . allCases. map ( \. rawValue) ) )
317321 }
318322}
319323
0 commit comments