@@ -65,6 +65,22 @@ extension Message {
6565 /// - Parameter jsonString: The JSON-formatted string to decode.
6666 /// - Parameter options: The JSONDecodingOptions to use.
6767 /// - Throws: `JSONDecodingError` if decoding fails.
68+ public static func array(
69+ fromJSONString jsonString: String ,
70+ options: JSONDecodingOptions = JSONDecodingOptions ( )
71+ ) throws -> [ Self ] {
72+ return try self . array ( fromJSONString: jsonString,
73+ extensions: SimpleExtensionMap ( ) ,
74+ options: options)
75+ }
76+
77+ /// Creates a new array of messages by decoding the given string containing a
78+ /// serialized array of messages in JSON format.
79+ ///
80+ /// - Parameter jsonString: The JSON-formatted string to decode.
81+ /// - Parameter extensions: The extension map to use with this decode
82+ /// - Parameter options: The JSONDecodingOptions to use.
83+ /// - Throws: `JSONDecodingError` if decoding fails.
6884 public static func array(
6985 fromJSONString jsonString: String ,
7086 extensions: ExtensionMap = SimpleExtensionMap ( ) ,
@@ -88,6 +104,24 @@ extension Message {
88104 /// as UTF-8 encoded text.
89105 /// - Parameter options: The JSONDecodingOptions to use.
90106 /// - Throws: `JSONDecodingError` if decoding fails.
107+ public static func array(
108+ fromJSONUTF8Data jsonUTF8Data: Data ,
109+ options: JSONDecodingOptions = JSONDecodingOptions ( )
110+ ) throws -> [ Self ] {
111+ return try self . array ( fromJSONUTF8Data: jsonUTF8Data,
112+ extensions: SimpleExtensionMap ( ) ,
113+ options: options)
114+ }
115+
116+ /// Creates a new array of messages by decoding the given `Data` containing a
117+ /// serialized array of messages in JSON format, interpreting the data as
118+ /// UTF-8 encoded text.
119+ ///
120+ /// - Parameter jsonUTF8Data: The JSON-formatted data to decode, represented
121+ /// as UTF-8 encoded text.
122+ /// - Parameter extensions: The extension map to use with this decode
123+ /// - Parameter options: The JSONDecodingOptions to use.
124+ /// - Throws: `JSONDecodingError` if decoding fails.
91125 public static func array(
92126 fromJSONUTF8Data jsonUTF8Data: Data ,
93127 extensions: ExtensionMap = SimpleExtensionMap ( ) ,
0 commit comments