3
3
// See the LICENSE file in the project root for more information
4
4
5
5
using System ;
6
- using System . Collections . Generic ;
7
6
using System . IO ;
8
7
using System . Text . Json ;
9
- using System . Text . Json . Serialization ;
10
8
using System . Threading ;
11
9
using System . Threading . Tasks ;
12
10
@@ -18,8 +16,8 @@ namespace Elastic.Transport;
18
16
/// </summary>
19
17
public abstract class SystemTextJsonSerializer : Serializer
20
18
{
21
- private readonly JsonSerializerOptions ? _options ;
22
- private readonly JsonSerializerOptions ? _indentedOptions ;
19
+ private readonly JsonSerializerOptions _options ;
20
+ private readonly JsonSerializerOptions _indentedOptions ;
23
21
24
22
/// <summary>
25
23
/// An abstract implementation of a transport <see cref="Serializer"/> which serializes using the Microsoft
@@ -90,8 +88,8 @@ public override Task SerializeAsync<T>(T data, Stream stream,
90
88
/// Returns the <see cref="JsonSerializerOptions"/> for this serializer, based on the given <paramref name="formatting"/>.
91
89
/// </summary>
92
90
/// <param name="formatting">The serialization formatting.</param>
93
- /// <returns>The requested <see cref="JsonSerializerOptions"/> or <c>null</c>, if the serializer is not initialized yet .</returns>
94
- protected internal JsonSerializerOptions ? GetJsonSerializerOptions ( SerializationFormatting formatting = SerializationFormatting . None ) =>
91
+ /// <returns>The requested <see cref="JsonSerializerOptions"/>.</returns>
92
+ protected internal JsonSerializerOptions GetJsonSerializerOptions ( SerializationFormatting formatting = SerializationFormatting . None ) =>
95
93
formatting is SerializationFormatting . None ? _options : _indentedOptions ;
96
94
97
95
private static bool TryReturnDefault < T > ( Stream ? stream , out T deserialize )
0 commit comments