You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jsonSerializerContext) as {(isDerivedClass?"T":typeName)}{(isValueType?"?":"")};
100
+
typeof({(isBaseClass?className:typeName)}),
101
+
jsonSerializerContext) as {(isBaseClass?"T":typeName)}{(isValueType?"?":"")};
103
102
}}
104
103
105
104
{"Deserializes a JSON string using the provided JsonSerializerOptions.".ToXmlDocumentationSummary(level:8)}
106
105
#if NET8_0_OR_GREATER
107
106
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(""JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved."")]
108
107
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode(""JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications."")]
109
108
#endif
110
-
public static {typeName}? FromJson{(isDerivedClass?"<T>":string.Empty)}(
109
+
public static {(isBaseClass?"T":typeName)}? FromJson{(isBaseClass?"<T>":string.Empty)}(
jsonSerializerOptions){(isDerivedClass?" as T":string.Empty)};
116
+
jsonSerializerOptions){(isBaseClass?" as T":string.Empty)};
118
117
}}
119
118
120
119
/// <summary>
121
120
/// Deserializes a JSON stream using the provided JsonSerializerContext.
122
121
/// </summary>
123
-
public static async global::System.Threading.Tasks.ValueTask<{typeName}?> FromJsonStreamAsync{(isDerivedClass?"<T>":string.Empty)}(
122
+
public static async global::System.Threading.Tasks.ValueTask<{(isBaseClass?"T?":$"{typeName}?")}> FromJsonStreamAsync{(isBaseClass?"<T>":string.Empty)}(
jsonSerializerContext).ConfigureAwait(false)) as {(isDerivedClass?"T":typeName)}{(isValueType?"?":"")};
129
+
typeof({(isBaseClass?className:typeName)}),
130
+
jsonSerializerContext).ConfigureAwait(false)) as {(isBaseClass?"T":typeName)}{(isValueType?"?":"")};
132
131
}}
133
132
133
+
{(isBaseClass?$@"
134
134
/// <summary>
135
135
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
136
136
/// </summary>
137
137
#if NET8_0_OR_GREATER
138
138
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(""JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved."")]
139
139
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode(""JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications."")]
140
140
#endif
141
-
public static global::System.Threading.Tasks.ValueTask<{typeName}?> FromJsonStreamAsync{(isDerivedClass?"<T>":string.Empty)}(
141
+
public static async global::System.Threading.Tasks.ValueTask<T?> FromJsonStreamAsync<T>(
jsonSerializerOptions).ConfigureAwait(false)) as T{(isValueType?"?":"")};
149
+
}}":$@"
150
+
/// <summary>
151
+
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
152
+
/// </summary>
153
+
#if NET8_0_OR_GREATER
154
+
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(""JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved."")]
155
+
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode(""JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications."")]
156
+
#endif
157
+
public static global::System.Threading.Tasks.ValueTask<{typeName}?> FromJsonStreamAsync(
Copy file name to clipboardExpand all lines: src/tests/AutoSDK.SnapshotTests/Snapshots/cohere/SystemTextJson/_#G.Models.ChatStreamEvent.Json.g.verified.cs
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
53
55
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
82
86
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
0 commit comments