Skip to content

Commit 6046679

Browse files
authored
Merge PR from feature branch into v4-development branch for System.Text.Json serialization (#3612)
* Updates serialization for JSON protocols to use System.Text.Json
1 parent 95f64da commit 6046679

File tree

625 files changed

+8708
-6900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

625 files changed

+8708
-6900
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"core": {
3+
"changeLogMessages": [
4+
"Updates serialization for JSON-based services to use System.Text.Json instead of LitJson for improved performance and smaller memory allocations."
5+
],
6+
"type": "patch",
7+
"updateMinimum": true
8+
}
9+
}

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte
273273
/// <returns></returns>
274274
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
275275
{
276-
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
276+
ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
277277
");
278278

279279
#line 121 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryEC2ResponseUnmarshaller.tt"

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryEC2ResponseUnmarshaller.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
117117
/// <returns></returns>
118118
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
119119
{
120-
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
120+
ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
121121
<#
122122
foreach (var exception in this.Operation.Exceptions)
123123
{

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace ServiceClientGenerator.Generators.Marshallers
1818
/// Class to produce the template output
1919
/// </summary>
2020

21-
#line 1 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
21+
#line 1 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
2222
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
2323
public partial class AWSQueryExceptionUnmarshaller : BaseResponseUnmarshaller
2424
{
@@ -29,7 +29,7 @@ public partial class AWSQueryExceptionUnmarshaller : BaseResponseUnmarshaller
2929
public override string TransformText()
3030
{
3131

32-
#line 6 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
32+
#line 6 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
3333

3434
AddLicenseHeader();
3535

@@ -40,29 +40,29 @@ public override string TransformText()
4040
#line hidden
4141
this.Write("#pragma warning disable CS0612,CS0618\r\nnamespace ");
4242

43-
#line 12 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
43+
#line 12 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
4444
this.Write(this.ToStringHelper.ToStringWithCulture(this.Config.Namespace));
4545

4646
#line default
4747
#line hidden
4848
this.Write(".Model.Internal.MarshallTransformations\r\n{\r\n /// <summary>\r\n /// Response U" +
4949
"nmarshaller for ");
5050

51-
#line 15 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
51+
#line 15 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
5252
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
5353

5454
#line default
5555
#line hidden
5656
this.Write(" operation\r\n /// </summary> \r\n public class ");
5757

58-
#line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
58+
#line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
5959
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
6060

6161
#line default
6262
#line hidden
63-
this.Write("Unmarshaller : IErrorResponseUnmarshaller<");
63+
this.Write("Unmarshaller : IXmlErrorResponseUnmarshaller<");
6464

65-
#line 17 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
65+
#line 17 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
6666
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
6767

6868
#line default
@@ -72,7 +72,7 @@ public override string TransformText()
7272
"\n /// <param name=\"context\"></param>\r\n /// <returns></returns>\r\n " +
7373
" public ");
7474

75-
#line 24 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
75+
#line 24 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
7676
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
7777

7878
#line default
@@ -90,22 +90,22 @@ public override string TransformText()
9090
/// <returns></returns>
9191
public ");
9292

93-
#line 35 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
93+
#line 35 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
9494
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
9595

9696
#line default
9797
#line hidden
9898
this.Write(" Unmarshall(XmlUnmarshallerContext context, Amazon.Runtime.Internal.ErrorResponse" +
9999
" errorResponse)\r\n {\r\n ");
100100

101-
#line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
101+
#line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
102102
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
103103

104104
#line default
105105
#line hidden
106106
this.Write(" response = new ");
107107

108-
#line 37 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
108+
#line 37 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
109109
this.Write(this.ToStringHelper.ToStringWithCulture(this.UnmarshallerBaseName));
110110

111111
#line default
@@ -125,7 +125,7 @@ public override string TransformText()
125125
{
126126
");
127127

128-
#line 50 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
128+
#line 50 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
129129

130130
if(this.Structure != null)
131131
{
@@ -138,14 +138,14 @@ public override string TransformText()
138138
#line hidden
139139
this.Write(" if (context.TestExpression(\"");
140140

141-
#line 57 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
141+
#line 57 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
142142
this.Write(this.ToStringHelper.ToStringWithCulture(testExpression));
143143

144144
#line default
145145
#line hidden
146146
this.Write("\", targetDepth))\r\n {\r\n");
147147

148-
#line 59 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
148+
#line 59 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
149149

150150
if (member.IsMap || member.IsList)
151151
{
@@ -155,42 +155,42 @@ public override string TransformText()
155155
#line hidden
156156
this.Write(" if (response.");
157157

158-
#line 63 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
158+
#line 63 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
159159
this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName)));
160160

161161
#line default
162162
#line hidden
163163
this.Write(" == null)\r\n {\r\n response.");
164164

165-
#line 65 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
165+
#line 65 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
166166
this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName)));
167167

168168
#line default
169169
#line hidden
170170
this.Write(" = new ");
171171

172-
#line 65 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
172+
#line 65 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
173173
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineType()));
174174

175175
#line default
176176
#line hidden
177177
this.Write("();\r\n }\r\n var item = ");
178178

179-
#line 67 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
179+
#line 67 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
180180
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate()));
181181

182182
#line default
183183
#line hidden
184184
this.Write(".Unmarshall(context);\r\n response.");
185185

186-
#line 68 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
186+
#line 68 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
187187
this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName)));
188188

189189
#line default
190190
#line hidden
191191
this.Write(".Add(item);\r\n");
192192

193-
#line 69 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
193+
#line 69 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
194194

195195
}
196196
else
@@ -201,21 +201,21 @@ public override string TransformText()
201201
#line hidden
202202
this.Write(" response.");
203203

204-
#line 74 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
204+
#line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
205205
this.Write(this.ToStringHelper.ToStringWithCulture(MemberAccessorFor(member.PropertyName)));
206206

207207
#line default
208208
#line hidden
209209
this.Write(" = ");
210210

211-
#line 74 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
211+
#line 74 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
212212
this.Write(this.ToStringHelper.ToStringWithCulture(member.DetermineTypeUnmarshallerInstantiate()));
213213

214214
#line default
215215
#line hidden
216216
this.Write(".Unmarshall(context);\r\n");
217217

218-
#line 75 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
218+
#line 75 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
219219

220220
}
221221

@@ -224,7 +224,7 @@ public override string TransformText()
224224
#line hidden
225225
this.Write(" }\r\n");
226226

227-
#line 79 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
227+
#line 79 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
228228

229229
}
230230
}
@@ -234,7 +234,7 @@ public override string TransformText()
234234
#line hidden
235235
this.Write(" }\r\n }\r\n return response;\r\n }\r\n\r\n");
236236

237-
#line 88 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
237+
#line 88 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
238238

239239
this.AddStructureSingletonMethod();
240240

@@ -245,7 +245,7 @@ public override string TransformText()
245245
return this.GenerationEnvironment.ToString();
246246
}
247247

248-
#line 94 "C:\codebase\v3\AWSDotNetPublic\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
248+
#line 94 "C:\Dev\Repos\aws-sdk-net-staging\generator\ServiceClientGeneratorLib\Generators\Marshallers\AWSQueryExceptionUnmarshaller.tt"
249249

250250
// if the result fields have been wrapped in a subordinate structure, wire the accessor
251251
// to use it when addressing a member

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryExceptionUnmarshaller.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
1414
/// <summary>
1515
/// Response Unmarshaller for <#=this.UnmarshallerBaseName #> operation
1616
/// </summary>
17-
public class <#=this.UnmarshallerBaseName #>Unmarshaller : IErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext>
17+
public class <#=this.UnmarshallerBaseName #>Unmarshaller : IXmlErrorResponseUnmarshaller<<#=this.UnmarshallerBaseName #>, XmlUnmarshallerContext>
1818
{
1919
/// <summary>
2020
/// Unmarshaller the response from the service to the response class.

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext conte
316316
/// <returns></returns>
317317
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
318318
{
319-
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
319+
ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
320320
errorResponse.InnerException = innerException;
321321
errorResponse.StatusCode = statusCode;
322322

generator/ServiceClientGeneratorLib/Generators/Marshallers/AWSQueryResponseUnmarshaller.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ namespace <#=this.Config.Namespace #>.Model.Internal.MarshallTransformations
138138
/// <returns></returns>
139139
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
140140
{
141-
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
141+
ErrorResponse errorResponse = XmlErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
142142
errorResponse.InnerException = innerException;
143143
errorResponse.StatusCode = statusCode;
144144

0 commit comments

Comments
 (0)