173 references to JsonException
aspire (10)
Configuration\FlexibleBooleanConverter.cs (2)
24_ => throw new JsonException($"Unexpected token parsing boolean. Token: {reader.TokenType}") 35throw new JsonException($"Invalid boolean value: '{value}'. Expected 'true' or 'false'.");
Configuration\FlexibleBooleanDictionaryConverter.cs (6)
25throw new JsonException($"Expected StartObject, got {reader.TokenType}"); 39throw new JsonException($"Expected PropertyName, got {reader.TokenType}"); 42var key = reader.GetString() ?? throw new JsonException("Property name cannot be null"); 51_ => throw new JsonException($"Cannot convert {reader.TokenType} to boolean for key '{key}'") 57throw new JsonException("Unexpected end of JSON"); 84throw new JsonException($"Cannot convert string '{value}' to boolean for key '{key}'. Expected 'true' or 'false'.");
Scaffolding\ScaffoldingService.cs (1)
301?? throw new JsonException("The root package.json is not a JSON object.");
Utils\EnvironmentChecker\EnvironmentCheckResult.cs (1)
145_ => throw new JsonException($"Unknown status value: {value}")
Aspire.Dashboard (7)
Model\GenAI\GenAIMessageParsingHelper.cs (6)
36throw new JsonException("Expected a JSON array."); 91throw new JsonException("Expected start of chat message object."); 107throw new JsonException("Expected property name."); 117throw new JsonException("Unexpected end of JSON while reading role value."); 128throw new JsonException("Unexpected end of JSON while reading property value."); 133throw new JsonException("Unexpected end of JSON while skipping property value.");
Model\GenAI\GenAIMessages.cs (1)
216throw new JsonException("Missing 'type' property.");
Aspire.Dashboard.Tests (1)
Model\GenAIItemPartViewModelTests.cs (1)
177Error = new JsonException("Test deserialization error"),
Aspire.Hosting (15)
Dcp\JsonPatch.cs (13)
37throw new JsonException("A JSON Patch operation must contain string 'op' and 'path' properties."); 140throw new JsonException($"JSON Pointer path '{path}' must be empty or start with '/'."); 165throw new JsonException($"JSON Pointer segment '{segment}' ends with an incomplete escape."); 172_ => throw new JsonException($"JSON Pointer segment '{segment}' contains an invalid escape."), 183throw new JsonException($"JSON Patch operation '{operation}' is not supported."); 188throw new JsonException($"JSON Patch operation '{operation}' requires a 'value' property."); 212throw new JsonException("A JSON Patch path can only traverse objects and arrays."); 220var parent = current ?? throw new JsonException("A JSON Patch path cannot traverse a null value."); 229?? throw new JsonException($"JSON Patch path segment '{segment}' refers to a null value."), 230_ => throw new JsonException($"JSON Patch path segment '{segment}' does not exist."), 247throw new JsonException($"JSON Patch remove path refers to missing property '{propertyName}'."); 253throw new JsonException($"JSON Patch replace path refers to missing property '{propertyName}'."); 293throw new JsonException($"JSON Patch array index '{indexText}' is invalid for an array with {count} elements.");
Dcp\Model\KubernetesMicroTimeJsonConverter.cs (2)
24throw new JsonException($"Expected a string token for Kubernetes MicroTime but found {reader.TokenType}."); 30throw new JsonException("Expected a non-empty Kubernetes MicroTime value.");
Aspire.Hosting.Browsers (5)
BrowserLogsCdpProtocol.cs (5)
829_ => throw new JsonException($"Unsupported JSON token '{reader.TokenType}' for tracked browser protocol value.") 868throw new JsonException($"Unsupported tracked browser protocol value type '{value.GetType()}'."); 909throw new JsonException("Tracked browser protocol object value was malformed."); 913?? throw new JsonException("Tracked browser protocol object property name was null."); 917throw new JsonException("Tracked browser protocol object value ended unexpectedly.");
Aspire.Hosting.Browsers.Tests (5)
src\Aspire.Hosting.Browsers\BrowserLogsCdpProtocol.cs (5)
829_ => throw new JsonException($"Unsupported JSON token '{reader.TokenType}' for tracked browser protocol value.") 868throw new JsonException($"Unsupported tracked browser protocol value type '{value.GetType()}'."); 909throw new JsonException("Tracked browser protocol object value was malformed."); 913?? throw new JsonException("Tracked browser protocol object property name was null."); 917throw new JsonException("Tracked browser protocol object value ended unexpectedly.");
Aspire.Hosting.RemoteHost (2)
Ats\AtsMarshaller.cs (2)
247throw new JsonException("TimeSpan milliseconds must be a finite number."); 266throw new JsonException("TimeSpan values must be milliseconds or a standard TimeSpan string.");
Microsoft.AspNetCore.Components.Server (3)
src\aspnetcore\src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Components.Web (13)
WebEventData\ChangeEventArgsReader.cs (1)
43throw new JsonException($"Unknown property {property.Name}");
WebEventData\ClipboardEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\DragEventArgsReader.cs (2)
73throw new JsonException($"Unknown property {property.Name}"); 95throw new JsonException($"Unknown property {property.Name}");
WebEventData\ErrorEventArgsReader.cs (1)
45throw new JsonException($"Unknown property {property.Name}");
WebEventData\FocusEventArgsReader.cs (1)
25throw new JsonException($"Unknown property {property.Name}");
WebEventData\KeyboardEventArgsReader.cs (1)
70throw new JsonException($"Unknown property {property.Name}");
WebEventData\MouseEventArgsReader.cs (1)
117throw new JsonException($"Unknown property {property.Name}");
WebEventData\ProgressEventArgReader.cs (1)
40throw new JsonException($"Unknown property {property.Name}");
WebEventData\TouchEventArgsReader.cs (2)
72throw new JsonException($"Unknown property {property.Name}"); 126throw new JsonException($"Unknown property {property.Name}");
WebEventData\WebEventDescriptorReader.cs (2)
38throw new JsonException($"Unknown property {property.Name}"); 72throw new JsonException($"Unknown property {property.Name}");
Microsoft.AspNetCore.Components.WebAssembly (3)
src\aspnetcore\src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Components.WebView (3)
src\aspnetcore\src\Components\Shared\src\ElementReferenceJsonConverter.cs (3)
34throw new JsonException($"Unexpected JSON property '{reader.GetString()}'."); 39throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 45throw new JsonException("__internalId is required.");
Microsoft.AspNetCore.Identity (2)
Passkeys\BufferSourceJsonConverter.cs (2)
24throw new JsonException("Unexpected escaped value in base64url string."); 30throw new JsonException("Expected a valid base64url string.");
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
Converters\JsonConverterForJsonPatchDocumentOfT.cs (1)
27throw new JsonException(Resources.InvalidJsonPatchDocument);
Converters\JsonPatchDocumentConverter.cs (1)
26throw new JsonException(Resources.InvalidJsonPatchDocument);
Microsoft.AspNetCore.OpenApi (6)
Schemas\OpenApiJsonSchema.cs (3)
23throw new JsonException("Expected StartObject token to represent beginning of schema."); 33var propertyName = reader.GetString() ?? throw new JsonException("Encountered unexpected missing property name."); 44throw new JsonException("Encountered unexpected EOF token without producing a schema.");
Schemas\OpenApiJsonSchema.Helpers.cs (3)
69throw new JsonException("Expected StartObject or Null"); 78throw new JsonException("Expected PropertyName"); 163throw new JsonException("Expected PropertyName");
Microsoft.Diagnostics.DataContractReader (3)
ContractDescriptorParser.cs (3)
163throw new JsonException($"Size specified multiple times: {size} and {newSize}"); 168throw new JsonException($"Duplicate field name: {fieldName}"); 291throw new JsonException("Indirect global value could not be converted to a number.");
Microsoft.Extensions.AI.Abstractions (2)
Embeddings\BinaryEmbedding.cs (2)
52throw new JsonException("Expected string property."); 77_ => throw new JsonException("Expected binary character sequence.")
Microsoft.Extensions.AI.Evaluation.Reporting (8)
JsonSerialization\EvaluationContextConverter.cs (5)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw new JsonException($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\DiskBasedResponseCache.CacheEntry.cs (2)
39throw new JsonException( 56throw new JsonException(
Storage\DiskBasedResultStore.cs (1)
78? throw new JsonException(
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (8)
parent\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\JsonSerialization\EvaluationContextConverter.cs (5)
27throw new JsonException($"Unexpected token '{reader.TokenType}'."); 45throw new JsonException( 54throw new JsonException( 64throw new JsonException( 77throw new JsonException($"Missing required properties '{NamePropertyName}' and '{ContentsPropertyName}'.");
Storage\AzureStorageResponseCache.CacheEntry.cs (2)
44?? throw new JsonException( 62?? throw new JsonException(
Storage\AzureStorageResultStore.cs (1)
119?? throw new JsonException(
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIResponseClientTests.cs (1)
6947throw new JsonException($"Unrecognized property '{propertyName}'.");
Microsoft.JSInterop (22)
Implementation\JSObjectReferenceJsonWorker.cs (3)
38throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 43throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 49throw new JsonException($"Required property {JSObjectIdKey} not found.");
Infrastructure\ByteArrayJsonConverter.cs (8)
33throw new JsonException("JSON serialization is attempting to deserialize an unexpected byte array."); 40throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'StartObject'."); 47throw new JsonException($"Unexpected JSON Property {reader.GetString()}."); 51throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'Number'."); 55throw new JsonException($"Unexpected number, expected 32-bit integer."); 60throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'PropertyName'."); 65throw new JsonException($"Unexpected JSON Token {reader.TokenType}, expected 'EndObject'."); 70throw new JsonException($"Byte array {byteArrayRef} not found.");
Infrastructure\DotNetDispatcher.cs (4)
232throw new JsonException("Invalid JSON"); 259throw new JsonException($"Unexpected JSON token {reader.TokenType}. Ensure that the call to `{methodIdentifier}' is supplied with exactly '{parameterTypes.Length}' parameters."); 319throw new JsonException("Invalid JSON"); 336throw new JsonException("Invalid JSON");
Infrastructure\DotNetObjectReferenceJsonConverter.cs (3)
37throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 42throw new JsonException($"Unexpected JSON Token {reader.TokenType}."); 48throw new JsonException($"Required property {DotNetObjectRefKey} not found.");
Infrastructure\JSStreamReferenceJsonConverter.cs (4)
45throw new JsonException($"Unexpected JSON property {reader.GetString()}."); 50throw new JsonException($"Unexpected JSON token {reader.TokenType}"); 56throw new JsonException($"Required property {JSObjectReferenceJsonWorker.JSObjectIdKey} not found."); 61throw new JsonException($"Required property {_jsStreamReferenceLengthKey} not found.");
Microsoft.ML.Tokenizers (1)
Utils\StringSpanOrdinalKey.cs (1)
166throw new JsonException("Invalid JSON.");
NuGet.ProjectModel (12)
LockFile\Utf8JsonStreamIAssetsLogMessageConverter.cs (1)
53throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileConverter.cs (1)
51throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileItemConverter.cs (1)
38throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileLibraryConverter.cs (2)
45throw new JsonException("Expected PropertyName, found " + reader.TokenType); 57throw new JsonException("Expected StartObject, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverter.cs (1)
24throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetConverterV4.cs (1)
23throw new JsonException("Expected PropertyName, found " + reader.TokenType);
LockFile\Utf8JsonStreamLockFileTargetLibraryConverter.cs (2)
80throw new JsonException("Expected PropertyName, found " + reader.TokenType); 94throw new JsonException("Expected StartObject, found " + reader.TokenType);
src\nuget-client\build\Shared\Utf8JsonStreamReader.cs (2)
133throw new JsonException($"Expected start object token but instead found '{TokenType}'"); 158throw new JsonException($"Expected start array token but instead found '{TokenType}'");
Utf8JsonStreamProjectFileDependencyGroupConverter.cs (1)
24throw new JsonException("Expected PropertyName, found " + reader.TokenType);
NuGet.Protocol (23)
Converters\MetadataStringOrArrayStjConverter.cs (2)
28throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 39throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
Converters\NuGetFrameworkStjConverter.cs (1)
28_ => throw new JsonException(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Converters\NuGetVersionStjConverter.cs (1)
24_ => throw new JsonException(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Converters\PackageDependencyGroupStjConverter.cs (4)
26throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 36throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 65throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType)); 72throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
Converters\Utf8JsonReaderExtensions.cs (1)
28_ => throw new JsonException(string.Format(System.Globalization.CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType))
Model\RepositoryCertificateInfo.cs (4)
51Fingerprints = fingerprints ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Fingerprints)); 52Subject = subject ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Subject)); 53Issuer = issuer ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.Issuer)); 56ContentUrl = contentUrl ?? throw new System.Text.Json.JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, JsonProperties.ContentUrl));
Plugins\MessageConverter.cs (8)
110throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.RequestId))); 116throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentCannotBeNullOrEmpty, nameof(Message.RequestId))); 121throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Type))); 127throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, typeStr)); 132throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_RequiredJsonPropertyMissing, nameof(Message.Method))); 138throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, methodStr)); 146throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, payloadProp.ValueKind)); 163throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Plugin_UnrecognizedEnumValue, $"{messageMethod}/{messageType}"));
Plugins\RawJsonStringConverter.cs (1)
22throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedPayloadTokenType, reader.TokenType));
Plugins\StjSemanticVersionConverter.cs (1)
23throw new JsonException(string.Format(CultureInfo.CurrentCulture, Strings.Error_UnexpectedJsonToken, reader.TokenType));
System.Text.Json (16)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (1)
283throw new JsonException(SR.Format(SR.FSharpUnionMissingDiscriminatorProperty, _typeDiscriminatorPropertyName, typeof(T)));
System\Text\Json\ThrowHelper.Serialization.cs (15)
52throw new JsonException(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true }; 70throw new JsonException(SR.Format(SR.PropertyGetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 76throw new JsonException(SR.Format(SR.PropertySetterDisallowNull, propertyName, declaringType)) { AppendPathInformation = true }; 82throw new JsonException(SR.Format(SR.ConstructorParameterDisallowNull, parameterName, declaringType)) { AppendPathInformation = true }; 130throw new JsonException(SR.Format(SR.SerializationConverterRead, converter)) { AppendPathInformation = true }; 136throw new JsonException(SR.Format(SR.SerializationConverterWrite, converter)) { AppendPathInformation = true }; 142throw new JsonException(SR.Format(SR.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true }; 148throw new JsonException(message) { AppendPathInformation = true }; 318throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, parent.Type, builder.ToString())); 324throw new JsonException(SR.Format(SR.JsonRequiredPropertiesMissing, type, propertyList)); 351throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_JsonPropertyInfo, property.Name, property.DeclaringType)); 357throw new JsonException(SR.DuplicatePropertiesNotAllowed); 363throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 370throw new JsonException(SR.Format(SR.DuplicatePropertiesNotAllowed_NameSpan, Truncate(name))); 760throw new JsonException(SR.Format(SR.UnmappedJsonProperty, unmappedPropertyName, type));