@@ -113,7 +113,7 @@ protected virtual JsonSerializer CreateJsonSerializer()
113113 if ( _serializerSettings == null )
114114 {
115115 // Lock the serializer settings once the first serialization has been initiated.
116- _serializerSettings = ShallowCopy ( SerializerSettings ) ;
116+ _serializerSettings = new JsonSerializerSettings ( SerializerSettings ) ;
117117 }
118118
119119 return JsonSerializer . Create ( _serializerSettings ) ;
@@ -190,44 +190,6 @@ public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext co
190190 }
191191 }
192192
193- private static JsonSerializerSettings ShallowCopy ( JsonSerializerSettings settings )
194- {
195- var copiedSettings = new JsonSerializerSettings
196- {
197- FloatParseHandling = settings . FloatParseHandling ,
198- FloatFormatHandling = settings . FloatFormatHandling ,
199- DateParseHandling = settings . DateParseHandling ,
200- DateTimeZoneHandling = settings . DateTimeZoneHandling ,
201- DateFormatHandling = settings . DateFormatHandling ,
202- Formatting = settings . Formatting ,
203- MaxDepth = settings . MaxDepth ,
204- DateFormatString = settings . DateFormatString ,
205- Context = settings . Context ,
206- Error = settings . Error ,
207- SerializationBinder = settings . SerializationBinder ,
208- TraceWriter = settings . TraceWriter ,
209- Culture = settings . Culture ,
210- ReferenceResolverProvider = settings . ReferenceResolverProvider ,
211- EqualityComparer = settings . EqualityComparer ,
212- ContractResolver = settings . ContractResolver ,
213- ConstructorHandling = settings . ConstructorHandling ,
214- TypeNameAssemblyFormatHandling = settings . TypeNameAssemblyFormatHandling ,
215- MetadataPropertyHandling = settings . MetadataPropertyHandling ,
216- TypeNameHandling = settings . TypeNameHandling ,
217- PreserveReferencesHandling = settings . PreserveReferencesHandling ,
218- Converters = settings . Converters ,
219- DefaultValueHandling = settings . DefaultValueHandling ,
220- NullValueHandling = settings . NullValueHandling ,
221- ObjectCreationHandling = settings . ObjectCreationHandling ,
222- MissingMemberHandling = settings . MissingMemberHandling ,
223- ReferenceLoopHandling = settings . ReferenceLoopHandling ,
224- CheckAdditionalContent = settings . CheckAdditionalContent ,
225- StringEscapeHandling = settings . StringEscapeHandling ,
226- } ;
227-
228- return copiedSettings ;
229- }
230-
231193 private static partial class Log
232194 {
233195 [ LoggerMessage ( 1 , LogLevel . Debug , "Buffering IAsyncEnumerable instance of type '{Type}'." , EventName = "BufferingAsyncEnumerable" , SkipEnabledCheck = true ) ]
0 commit comments