440 references to TokenType
Aspire.Dashboard (1)
Components\Dialogs\TextVisualizerDialog.razor.cs (1)
196switch (reader.TokenType)
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
539if (reader.TokenType == JsonTokenType.PropertyName)
Microsoft.AspNetCore.Components.Server (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName) 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}.");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName) 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}.");
Microsoft.AspNetCore.Components.WebView (3)
src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
23while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 25if (reader.TokenType == JsonTokenType.PropertyName) 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}.");
Microsoft.AspNetCore.Grpc.JsonTranscoding (11)
Internal\Json\DurationConverter.cs (1)
20if (reader.TokenType != JsonTokenType.String)
Internal\Json\EnumConverter.cs (2)
21switch (reader.TokenType) 43throw new InvalidOperationException($"Unexpected JSON token: {reader.TokenType}.");
Internal\Json\FieldMaskConverter.cs (1)
24if (reader.TokenType != JsonTokenType.String)
Internal\Json\Int64Converter.cs (1)
18if (reader.TokenType == JsonTokenType.String)
Internal\Json\NullValueConverter.cs (2)
17switch (reader.TokenType) 33throw new InvalidOperationException($"Unexpected JSON token: {reader.TokenType}");
Internal\Json\TimestampConverter.cs (1)
20if (reader.TokenType != JsonTokenType.String)
Internal\Json\UInt64Converter.cs (1)
19if (reader.TokenType == JsonTokenType.String)
Internal\Json\ValueConverter.cs (2)
23switch (reader.TokenType) 57throw new InvalidOperationException("Unexpected token type: " + reader.TokenType);
Microsoft.AspNetCore.Http.Connections.Common (17)
NegotiateProtocol.cs (8)
167switch (reader.TokenType) 198if (reader.TokenType == JsonTokenType.StartObject) 202else if (reader.TokenType == JsonTokenType.EndArray) 229throw new InvalidDataException($"Unexpected token '{reader.TokenType}' when reading negotiation response JSON."); 279switch (reader.TokenType) 296switch (reader.TokenType) 305throw new InvalidDataException($"Unexpected token '{reader.TokenType}' when reading transfer formats JSON."); 327throw new InvalidDataException($"Unexpected token '{reader.TokenType}' when reading available transport JSON.");
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23if (reader.TokenType != JsonTokenType.StartObject) 31return GetTokenString(reader.TokenType); 54if (reader.TokenType != JsonTokenType.StartArray) 64return reader.TokenType switch 76if (reader.TokenType != JsonTokenType.String) 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\SharedTypes.cs (1)
990if (reader.TokenType == JsonTokenType.EndObject)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
990if (reader.TokenType == JsonTokenType.EndObject)
Microsoft.AspNetCore.OpenApi (22)
Schemas\OpenApiJsonSchema.cs (2)
21if (reader.TokenType != JsonTokenType.StartObject) 28switch (reader.TokenType)
Schemas\OpenApiJsonSchema.Helpers.cs (20)
22if (reader.TokenType == JsonTokenType.Null) 27if (reader.TokenType == JsonTokenType.StartArray) 31while (reader.TokenType != JsonTokenType.EndArray) 40if (reader.TokenType == JsonTokenType.Null) 57if (reader.TokenType == JsonTokenType.Null) 62if (reader.TokenType != JsonTokenType.StartObject) 69while (reader.TokenType != JsonTokenType.EndObject) 71if (reader.TokenType != JsonTokenType.PropertyName) 91if (reader.TokenType == JsonTokenType.Null) 96if (reader.TokenType == JsonTokenType.True || reader.TokenType == JsonTokenType.False) 102if (reader.TokenType == JsonTokenType.Number) 129if (reader.TokenType == JsonTokenType.String) 135if (reader.TokenType == JsonTokenType.StartArray) 139while (reader.TokenType != JsonTokenType.EndArray) 147if (reader.TokenType == JsonTokenType.StartObject) 152while (reader.TokenType != JsonTokenType.EndObject) 154if (reader.TokenType != JsonTokenType.PropertyName) 183if (reader.TokenType == JsonTokenType.StartArray) 283if (reader.TokenType == JsonTokenType.False)
Microsoft.AspNetCore.SignalR.Common (15)
Protocol\HandshakeProtocol.cs (6)
133if (reader.TokenType == JsonTokenType.PropertyName) 150else if (reader.TokenType == JsonTokenType.EndObject) 156throw new InvalidDataException($"Unexpected token '{reader.TokenType}' when reading handshake response JSON."); 188if (reader.TokenType == JsonTokenType.PropertyName) 203else if (reader.TokenType == JsonTokenType.EndObject) 209throw new InvalidDataException($"Unexpected token '{reader.TokenType}' when reading handshake request JSON. Message content: {GetPayloadAsString()}");
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23if (reader.TokenType != JsonTokenType.StartObject) 31return GetTokenString(reader.TokenType); 54if (reader.TokenType != JsonTokenType.StartArray) 64return reader.TokenType switch 76if (reader.TokenType != JsonTokenType.String) 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number)
Microsoft.AspNetCore.SignalR.Protocols.Json (19)
Protocol\JsonHubProtocol.cs (10)
155switch (reader.TokenType) 175if (reader.TokenType != JsonTokenType.StartArray) 183while (reader.TokenType != JsonTokenType.EndArray) 197if (reader.TokenType != JsonTokenType.String) 291if (reader.TokenType != JsonTokenType.StartArray) 318while (reader.CurrentDepth == initialDepth && reader.TokenType == JsonTokenType.StartArray || 485if (reader.TokenType != JsonTokenType.StartObject) 492switch (reader.TokenType) 499if (reader.TokenType != JsonTokenType.String) 841while (reader.TokenType != JsonTokenType.EndArray && reader.CurrentDepth > depth)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23if (reader.TokenType != JsonTokenType.StartObject) 31return GetTokenString(reader.TokenType); 54if (reader.TokenType != JsonTokenType.StartArray) 64return reader.TokenType switch 76if (reader.TokenType != JsonTokenType.String) 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (9)
src\SignalR\common\Shared\SystemTextJsonExtensions.cs (9)
23if (reader.TokenType != JsonTokenType.StartObject) 31return GetTokenString(reader.TokenType); 54if (reader.TokenType != JsonTokenType.StartArray) 64return reader.TokenType switch 76if (reader.TokenType != JsonTokenType.String) 88if (reader.TokenType == JsonTokenType.Null) 93if (reader.TokenType != JsonTokenType.Number) 105if (reader.TokenType == JsonTokenType.Null) 110if (reader.TokenType != JsonTokenType.Number)
Microsoft.CodeAnalysis.LanguageServer.Protocol (34)
Protocol\Converters\FormattingOptionsConverter.cs (8)
23Debug.Assert(reader.TokenType == JsonTokenType.StartObject); 34while (reader.TokenType == JsonTokenType.Comment); 54if (reader.TokenType == JsonTokenType.EndObject) 67if (reader.TokenType == JsonTokenType.Comment) 72if (reader.TokenType != JsonTokenType.PropertyName) 74throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.TokenType)); 102SumType<bool, int, string> value = reader.TokenType switch 108_ => throw new JsonException(string.Format(CultureInfo.InvariantCulture, LanguageServerProtocolResources.FormattingOptionsEncounteredInvalidToken, reader.TokenType))
Protocol\Converters\NaturalObjectConverter.cs (2)
34switch (reader.TokenType) 59while (reader.Read() && reader.TokenType != JsonTokenType.EndArray)
Protocol\Converters\StringEnumConverter.cs (2)
40if (reader.TokenType == JsonTokenType.String) 44else if (reader.TokenType == JsonTokenType.Null)
Protocol\Converters\SumConverter.cs (3)
188if (reader.TokenType == JsonTokenType.Null) 198var applicableUnionTypeInfos = sumTypeInfoCache.GetApplicableInfos(reader.TokenType); 279switch (reader.TokenType)
Protocol\Converters\TextDocumentSyncConverter.cs (3)
16if (reader.TokenType == JsonTokenType.Number) 31else if (reader.TokenType == JsonTokenType.String) 36else if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ClassifiedTextElementConverter.cs (3)
22if (reader.TokenType == JsonTokenType.EndObject) 27if (reader.TokenType == JsonTokenType.PropertyName) 36if (reader.TokenType == JsonTokenType.EndArray)
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (1)
17if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ContainerElementConverter.cs (4)
21if (reader.TokenType == JsonTokenType.StartObject) 28if (reader.TokenType == JsonTokenType.EndObject) 33if (reader.TokenType == JsonTokenType.PropertyName) 42if (reader.TokenType == JsonTokenType.EndArray)
Protocol\Internal\Converters\ImageElementConverter.cs (3)
18if (reader.TokenType == JsonTokenType.StartObject) 25if (reader.TokenType == JsonTokenType.EndObject) 31if (reader.TokenType == JsonTokenType.PropertyName)
Protocol\Internal\Converters\ImageIdConverter.cs (1)
17if (reader.TokenType == JsonTokenType.StartObject)
Protocol\Internal\Converters\ObjectContentConverter.cs (4)
40if (reader.TokenType == JsonTokenType.Null) 45else if (reader.TokenType == JsonTokenType.StartObject) 68else if (reader.TokenType == JsonTokenType.String) 72else if (reader.TokenType == JsonTokenType.Number)
Microsoft.Extensions.DependencyModel (15)
Utf8JsonReaderExtensions.cs (15)
16=> reader.TokenType == JsonTokenType.PropertyName; 28if (reader.TokenType == JsonTokenType.String) 52if (reader.TokenType != JsonTokenType.StartObject) 60if (reader.TokenType != JsonTokenType.EndObject) 69if (reader.TokenType != JsonTokenType.StartArray) 76while (reader.Read() && reader.TokenType == JsonTokenType.String) 81if (reader.TokenType != JsonTokenType.EndArray) 93if (reader.TokenType == JsonTokenType.Null) 97if (reader.TokenType != JsonTokenType.String) 109if (reader.TokenType == JsonTokenType.Null) 113if (reader.TokenType != JsonTokenType.True && reader.TokenType != JsonTokenType.False) 124if (reader.TokenType == JsonTokenType.Null) 128if (reader.TokenType != JsonTokenType.True && reader.TokenType != JsonTokenType.False)
Microsoft.JSInterop (26)
Implementation\JSObjectReferenceJsonWorker.cs (3)
27while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 29if (reader.TokenType == JsonTokenType.PropertyName) 43throw new JsonException($"Unexpected JSON token {reader.TokenType}");
Infrastructure\ByteArrayJsonConverter.cs (9)
26if (reader.TokenType == JsonTokenType.String && reader.TryGetBytesFromBase64(out var bytes)) 38if (reader.TokenType != JsonTokenType.StartObject) 40throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'StartObject'."); 43if (reader.Read() && reader.TokenType == JsonTokenType.PropertyName) 49else if (!reader.Read() || reader.TokenType != JsonTokenType.Number) 51throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'Number'."); 60throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'PropertyName'."); 63if (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 65throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'EndObject'.");
Infrastructure\DotNetDispatcher.cs (8)
230if (!reader.Read() || reader.TokenType != JsonTokenType.StartArray) 238while (index < parameterTypes.Length && reader.Read() && reader.TokenType != JsonTokenType.EndArray) 241if (reader.TokenType == JsonTokenType.StartObject && IsIncorrectDotNetObjectRefUse(parameterType, reader)) 256if (!reader.Read() || reader.TokenType != JsonTokenType.EndArray) 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 271jsonReader.TokenType == JsonTokenType.PropertyName && 317if (!reader.Read() || reader.TokenType != JsonTokenType.StartArray) 334if (!reader.Read() || reader.TokenType != JsonTokenType.EndArray)
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
26while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 28if (reader.TokenType == JsonTokenType.PropertyName) 42throw new JsonException($"Unexpected JSON Token {reader.TokenType}.");
Infrastructure\JSStreamReferenceJsonConverter.cs (3)
29while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) 31if (reader.TokenType == JsonTokenType.PropertyName) 50throw new JsonException($"Unexpected JSON token {reader.TokenType}");
Microsoft.ML.SearchSpace (3)
Converter\ParameterConverter.cs (3)
17switch (reader.TokenType) 43while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) 50throw new ArgumentException($"Unsupported reader type {reader.TokenType}");
Microsoft.ML.Tokenizers (2)
Utils\StringSpanOrdinalKey.cs (2)
153if (reader.TokenType == JsonTokenType.EndObject) 158if (reader.TokenType == JsonTokenType.PropertyName)
System.Text.Json (252)
System\Text\Json\Document\JsonDocument.cs (1)
964JsonTokenType tokenType = reader.TokenType;
System\Text\Json\Document\JsonDocument.Parse.cs (8)
352/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 392/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 444switch (reader.TokenType) 472switch (reader.TokenType) 509reader.TokenType == JsonTokenType.EndObject || 510reader.TokenType == JsonTokenType.EndArray); 532document = CreateForLiteral(reader.TokenType); 666document = ParseUnrented(owned, state.Options, reader.TokenType);
System\Text\Json\Document\JsonElement.Parse.cs (2)
21/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 86/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/>
System\Text\Json\JsonHelpers.cs (3)
23Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 86JsonTokenType tokenType = reader.TokenType; 104Debug.Assert(tokenType == reader.TokenType);
System\Text\Json\Nodes\JsonNode.Parse.cs (1)
24/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/>
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (1)
60return JsonReaderHelper.ToValueKind(reader.TokenType);
System\Text\Json\Reader\Utf8JsonReader.cs (19)
110if (TokenType is JsonTokenType.StartArray or JsonTokenType.StartObject) 284if (_isFinalBlock && TokenType is JsonTokenType.None && !_readerOptions.AllowMultipleValues) 303/// When <see cref="TokenType"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value. 304/// When <see cref="TokenType"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or 326if (TokenType is JsonTokenType.PropertyName) 334if (TokenType is JsonTokenType.StartObject or JsonTokenType.StartArray) 362/// When <see cref="TokenType"/> is <see cref="JsonTokenType.PropertyName" />, the reader first moves to the property value. 363/// When <see cref="TokenType"/> (originally, or after advancing) is <see cref="JsonTokenType.StartObject" /> or 403if (TokenType is JsonTokenType.PropertyName) 412if (TokenType is not (JsonTokenType.StartObject or JsonTokenType.StartArray)) 441/// <seealso cref="TokenType" /> 455if (!IsTokenTypeString(TokenType)) 457ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); 471/// <seealso cref="TokenType" /> 512/// <seealso cref="TokenType" /> 526if (!IsTokenTypeString(TokenType)) 528ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); 2563=> TokenType switch 2577_ => ((byte)TokenType).ToString()
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (74)
18/// Returns <see langword="null" /> when <see cref="TokenType"/> is <see cref="JsonTokenType.Null"/>. 24/// <seealso cref="TokenType" /> 29if (TokenType == JsonTokenType.Null) 34if (TokenType != JsonTokenType.String && TokenType != JsonTokenType.PropertyName) 36ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 65/// <seealso cref="TokenType" /> 129/// <seealso cref="TokenType" /> 237/// <seealso cref="TokenType" /> 241if (TokenType != JsonTokenType.Comment) 243ThrowHelper.ThrowInvalidOperationException_ExpectedComment(TokenType); 255/// <seealso cref="TokenType" /> 259JsonTokenType type = TokenType; 267ThrowHelper.ThrowInvalidOperationException_ExpectedBoolean(TokenType); 280/// <seealso cref="TokenType" /> 303/// <seealso cref="TokenType" /> 337/// <seealso cref="TokenType" /> 372/// <seealso cref="TokenType" /> 406/// <seealso cref="TokenType" /> 440/// <seealso cref="TokenType" /> 474/// <seealso cref="TokenType" /> 509/// <seealso cref="TokenType" /> 544/// <seealso cref="TokenType" /> 579/// <seealso cref="TokenType" /> 636/// <seealso cref="TokenType" /> 693/// <seealso cref="TokenType" /> 726/// <seealso cref="TokenType" /> 759/// <seealso cref="TokenType" /> 792/// <seealso cref="TokenType" /> 825/// <seealso cref="TokenType" /> 829if (TokenType != JsonTokenType.String) 831ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 853/// <seealso cref="TokenType" /> 857if (TokenType != JsonTokenType.Number) 859ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 888/// <seealso cref="TokenType" /> 893if (TokenType != JsonTokenType.Number) 895ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 924/// <seealso cref="TokenType" /> 928if (TokenType != JsonTokenType.Number) 930ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 959/// <seealso cref="TokenType" /> 963if (TokenType != JsonTokenType.Number) 965ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 994/// <seealso cref="TokenType" /> 998if (TokenType != JsonTokenType.Number) 1000ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1029/// <seealso cref="TokenType" /> 1034if (TokenType != JsonTokenType.Number) 1036ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1065/// <seealso cref="TokenType" /> 1070if (TokenType != JsonTokenType.Number) 1072ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1101/// <seealso cref="TokenType" /> 1106if (TokenType != JsonTokenType.Number) 1108ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1137/// <seealso cref="TokenType" /> 1141if (TokenType != JsonTokenType.Number) 1143ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1167/// <seealso cref="TokenType" /> 1171if (TokenType != JsonTokenType.Number) 1173ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1197/// <seealso cref="TokenType" /> 1201if (TokenType != JsonTokenType.Number) 1203ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); 1232/// <seealso cref="TokenType" /> 1236if (TokenType != JsonTokenType.String) 1238ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 1297/// <seealso cref="TokenType" /> 1301if (TokenType != JsonTokenType.String) 1303ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); 1363/// <seealso cref="TokenType" /> 1367if (TokenType != JsonTokenType.String) 1369ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (9)
75if (reader.TokenType != JsonTokenType.StartArray) 92if (reader.TokenType == JsonTokenType.EndArray) 108if (reader.TokenType == JsonTokenType.EndArray) 124if (reader.TokenType == JsonTokenType.StartArray) 130if (reader.TokenType != JsonTokenType.StartObject) 217if (reader.TokenType == JsonTokenType.EndArray) 264if (reader.TokenType != JsonTokenType.EndObject) 266Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 272Debug.Assert(reader.TokenType is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
87if (reader.TokenType != JsonTokenType.StartObject) 107if (reader.TokenType == JsonTokenType.EndObject) 113Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 133if (reader.TokenType == JsonTokenType.EndObject) 139Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 157if (reader.TokenType != JsonTokenType.StartObject) 240if (reader.TokenType == JsonTokenType.EndObject) 246Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverter.cs (1)
21if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Collection\ReadOnlyMemoryConverter.cs (1)
21if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (2)
36if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 85if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (2)
36if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 87if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
25switch (reader.TokenType) 33throw ThrowHelper.GetInvalidOperationException_ExpectedArray(reader.TokenType);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
41switch (reader.TokenType)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (2)
50switch (reader.TokenType) 58throw ThrowHelper.GetInvalidOperationException_ExpectedObject(reader.TokenType);
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
25if (reader.TokenType is JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (4)
30if (reader.TokenType != JsonTokenType.StartObject) 60if (reader.TokenType != JsonTokenType.StartObject) 165JsonTokenType tokenType = reader.TokenType; 282JsonTokenType tokenType = reader.TokenType;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (5)
43if (reader.TokenType != JsonTokenType.StartObject) 94Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 123if (reader.TokenType != JsonTokenType.StartObject) 292JsonTokenType tokenType = reader.TokenType; 402JsonTokenType tokenType = reader.TokenType;
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteArrayConverter.cs (1)
12if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String && (JsonNumberHandling.AllowReadingFromString & handling) != 0)
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (5)
15if (reader.TokenType is not (JsonTokenType.String or JsonTokenType.PropertyName)) 17ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 22ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.TokenType); 30ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.TokenType); 49Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
17if (reader.TokenType != JsonTokenType.String) 19ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (2)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 39if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (2)
104switch (reader.TokenType) 238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
24Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (4)
23if (reader.TokenType != JsonTokenType.Number) 25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 87if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (4)
23if (reader.TokenType != JsonTokenType.Number) 25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 81if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (2)
28if (reader.TokenType != JsonTokenType.PropertyName) 30ThrowHelper.ThrowInvalidOperationException_ExpectedPropertyName(reader.TokenType);
System\Text\Json\Serialization\Converters\Value\MemoryByteConverter.cs (1)
15return reader.TokenType is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (3)
30if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) 64if (reader.TokenType == JsonTokenType.Null) 87if (reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Converters\Value\ReadOnlyMemoryByteConverter.cs (1)
15return reader.TokenType is JsonTokenType.Null ? default : reader.GetBytesFromBase64();
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String)
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
32Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (4)
19if (reader.TokenType != JsonTokenType.String) 21ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
19if (reader.TokenType != JsonTokenType.String) 21ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (4)
23if (reader.TokenType != JsonTokenType.Number) 25ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(reader.TokenType); 68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 81if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (2)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 41if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (2)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 40if (reader.TokenType == JsonTokenType.String &&
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (2)
14return reader.TokenType is JsonTokenType.Null ? null : ReadCore(ref reader); 30Debug.Assert(reader.TokenType is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (4)
22if (reader.TokenType is JsonTokenType.Null) 27if (reader.TokenType != JsonTokenType.String) 29ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); 37Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String);
System\Text\Json\Serialization\JsonConverterOfT.cs (7)
151if (reader.TokenType == JsonTokenType.Null && !HandleNullOnRead && !state.IsContinuation) 183JsonTokenType originalPropertyTokenType = reader.TokenType; 242state.Current.OriginalTokenType = reader.TokenType; 506if (reader.TokenType != JsonTokenType.EndArray) 518if (reader.TokenType != JsonTokenType.EndObject) 553Debug.Assert(reader.TokenType == tokenType); 605Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (12)
67if (reader.TokenType == JsonTokenType.EndObject) 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 214if (reader.TokenType != JsonTokenType.String) 216ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 228if (reader.TokenType != JsonTokenType.String) 230ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 244switch (reader.TokenType) 253ThrowHelper.ThrowJsonException_MetadataValueWasNotString(reader.TokenType); 261if (reader.TokenType != JsonTokenType.StartArray) 263ThrowHelper.ThrowJsonException_MetadataValuesInvalidToken(reader.TokenType); 494switch (reader.TokenType) 509Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (8)
35/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 89/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 140/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 189/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 250/// If the <see cref="Utf8JsonReader.TokenType"/> property of <paramref name="reader"/> 345switch (reader.TokenType) 363switch (reader.TokenType) 389Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (2)
857if (reader.TokenType == JsonTokenType.Null) 906if (JsonTypeInfo.ElementType == JsonTypeInfo.ObjectType && reader.TokenType == JsonTokenType.Null)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
279bool isNullToken = reader.TokenType == JsonTokenType.Null; 368bool isNullToken = reader.TokenType == JsonTokenType.Null;
System\Text\Json\ThrowHelper.cs (1)
438message = SR.Format(SR.InvalidEndOfJsonNonPrimitive, json.TokenType);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
168_tokenType = reader.TokenType; 259_tokenType = reader.TokenType;
System.Windows.Forms.Tests (2)
System\Windows\Forms\DataObjectTests.cs (2)
2934if (reader.TokenType == JsonTokenType.EndObject) 2945if (reader.TokenType != JsonTokenType.PropertyName)