4 instantiations of JsonDocument
System.Text.Json (4)
System\Text\Json\Document\JsonDocument.cs (1)
719new JsonDocument(
System\Text\Json\Document\JsonDocument.Parse.cs (3)
712return new JsonDocument(utf8Json, database, isDisposable: false); 731document = new JsonDocument(utf8Json, database, extraRentedArrayPoolBytes, extraPooledByteBufferWriter, isDisposable: true); 789JsonDocument document = new JsonDocument(utf8Json, database, isDisposable: false);
545 references to JsonDocument
aspire (40)
Commands\McpCallCommand.cs (2)
92using var doc = JsonDocument.Parse(inputJson);
Configuration\AspireConfigFile.cs (2)
211using var doc = JsonDocument.Parse(json, ConfigurationHelper.ParseOptions);
DotNet\DotNetCliRunner.cs (4)
30Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken); 314public async Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken) 407var json = JsonDocument.Parse(stdout);
Mcp\Tools\DoctorTool.cs (1)
21return JsonDocument.Parse("""
Mcp\Tools\ExecuteResourceCommandTool.cs (1)
26return JsonDocument.Parse("""
Mcp\Tools\GetDocTool.cs (1)
27return JsonDocument.Parse("""
Mcp\Tools\ListAppHostsTool.cs (1)
35return JsonDocument.Parse("{ \"type\": \"object\", \"properties\": {} }").RootElement;
Mcp\Tools\ListConsoleLogsTool.cs (1)
25return JsonDocument.Parse("""
Mcp\Tools\ListDocsTool.cs (1)
30return JsonDocument.Parse("""
Mcp\Tools\ListIntegrationsTool.cs (1)
60return JsonDocument.Parse("""
Mcp\Tools\ListResourcesTool.cs (1)
54return JsonDocument.Parse("{ \"type\": \"object\", \"properties\": {} }").RootElement;
Mcp\Tools\ListStructuredLogsTool.cs (1)
30return JsonDocument.Parse("""
Mcp\Tools\ListTracesTool.cs (1)
30return JsonDocument.Parse("""
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
30return JsonDocument.Parse("""
Mcp\Tools\RefreshToolsTool.cs (1)
17return JsonDocument.Parse("{ \"type\": \"object\", \"properties\": {} }").RootElement;
Mcp\Tools\SearchDocsTool.cs (1)
29return JsonDocument.Parse("""
Mcp\Tools\SelectAppHostTool.cs (1)
21return JsonDocument.Parse("""
Projects\FallbackProjectParser.cs (5)
37public JsonDocument ParseProject(FileInfo projectFile) 72private static JsonDocument ParseCsprojProjectFile(FileInfo projectFile) 97private static JsonDocument ParseCsAppHostFile(FileInfo projectFile) 116private static JsonDocument BuildJsonDocument( 159return JsonDocument.Parse(rootObject.ToJsonString());
Projects\GuestAppHostProject.cs (2)
640using var doc = JsonDocument.Parse(json, ConfigurationHelper.ParseOptions);
Projects\ProjectLocator.cs (2)
219var json = await JsonDocument.ParseAsync(stream, cancellationToken: cancellationToken);
Projects\ProjectUpdater.cs (7)
172private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, CancellationToken cancellationToken) 177private async Task<JsonDocument> GetItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, CancellationToken cancellationToken) 197private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, UpdateContext context, CancellationToken cancellationToken) 202private async Task<JsonDocument> GetItemsAndPropertiesWithFallbackAsync(FileInfo projectFile, string[] items, string[] properties, UpdateContext context, CancellationToken cancellationToken) 261var itemsAndPropertiesDocument = await GetItemsAndPropertiesWithFallbackAsync(context.AppHostProjectFile, context, cancellationToken); 606var itemsAndPropertiesDocument = IsAppHostProject(projectFile, context) 835var document = await GetItemsAndPropertiesAsync(
src\Shared\PackageUpdateHelpers.cs (2)
132using var document = JsonDocument.Parse(stdout);
Aspire.Cli.EndToEnd.Tests (4)
McpDocsE2ETests.cs (2)
281using var parsed = JsonDocument.Parse(schemaString);
ProjectReferenceTests.cs (2)
52using var doc = JsonDocument.Parse(configJson);
Aspire.Cli.Tests (89)
Agents\SigstoreNpmProvenanceCheckerTests.cs (4)
22var bundleDoc = JsonDocument.Parse(bundleJson); 89var doc = JsonDocument.Parse(bundleJson);
Backchannel\BackchannelJsonSerializerContextTests.cs (3)
28InputSchema = JsonDocument.Parse("{\"type\":\"object\",\"properties\":{\"sql\":{\"type\":\"string\"}}}").RootElement 51["sql"] = JsonDocument.Parse("\"select 1\"").RootElement, 52["limit"] = JsonDocument.Parse("1").RootElement
Commands\PsCommandTests.cs (4)
188var document = JsonDocument.Parse(json); 322var document = JsonDocument.Parse(jsonOutput);
Commands\RunCommandTests.cs (2)
1372var doc = JsonDocument.Parse(json);
Mcp\E2E\McpDocsE2ETests.cs (2)
251using var parsed = JsonDocument.Parse(schemaString);
Mcp\ExecuteResourceCommandToolTests.cs (3)
17var doc = JsonDocument.Parse($$""" 147var partialArgs = JsonDocument.Parse("""{"resourceName": "test"}""").RootElement
Mcp\ListConsoleLogsToolTests.cs (6)
24["resourceName"] = JsonDocument.Parse("\"test-resource\"").RootElement 63["resourceName"] = JsonDocument.Parse("\"test-resource\"").RootElement 98["resourceName"] = JsonDocument.Parse("\"api-service\"").RootElement 132["resourceName"] = JsonDocument.Parse("\"api-service\"").RootElement 162["resourceName"] = JsonDocument.Parse("\"api-service\"").RootElement 191["resourceName"] = JsonDocument.Parse("\"api-service\"").RootElement
Mcp\ListIntegrationsToolTests.cs (6)
62using var json = JsonDocument.Parse(textContent.Text); 87using var json = JsonDocument.Parse(textContent.Text); 121using var json = JsonDocument.Parse(((ModelContextProtocol.Protocol.TextContentBlock)result.Content![0]).Text);
Mcp\ListResourcesToolTests.cs (2)
175var jsonDoc = JsonDocument.Parse(jsonPortion);
Mcp\ListStructuredLogsToolTests.cs (1)
335["resourceName"] = JsonDocument.Parse("\"non-existent-resource\"").RootElement
Mcp\ListTracesToolTests.cs (2)
317["resourceName"] = JsonDocument.Parse("\"non-existent-resource\"").RootElement 420["resourceName"] = JsonDocument.Parse("\"api-service\"").RootElement
Projects\FallbackProjectParserTests.cs (13)
15private static string FormatJson(JsonDocument document) 36var result = parser.ParseProject(new FileInfo(projectFile)); 61var result = parser.ParseProject(new FileInfo(projectFile)); 86var result = parser.ParseProject(new FileInfo(projectFile)); 111var result = parser.ParseProject(new FileInfo(projectFile)); 137var result = parser.ParseProject(new FileInfo(projectFile)); 163var result = parser.ParseProject(new FileInfo(projectFile)); 222var result = parser.ParseProject(new FileInfo(projectFile)); 252var result = parser.ParseProject(new FileInfo(projectFile)); 275var result = parser.ParseProject(new FileInfo(projectFile)); 299var result = parser.ParseProject(new FileInfo(projectFile)); 322var result = parser.ParseProject(new FileInfo(projectFile)); 344var result = parser.ParseProject(new FileInfo(projectFile));
Projects\ProjectUpdaterTests.cs (38)
95var document = JsonDocument.Parse(json); 206var document = JsonDocument.Parse(json); 345var document = JsonDocument.Parse(json); 498var document = JsonDocument.Parse(json); 642var document = JsonDocument.Parse(json); 747var document = JsonDocument.Parse(json); 849var document = JsonDocument.Parse(json); 993var document = JsonDocument.Parse(json); 1116var document = JsonDocument.Parse(json); 1230var document = JsonDocument.Parse(json); 1340var document = JsonDocument.Parse(json); 1706var document = JsonDocument.Parse(json); 1780var document = JsonDocument.Parse(json); 1863var document = JsonDocument.Parse(json); 1946var document = JsonDocument.Parse(json); 2033var document = JsonDocument.Parse(json); 2112var document = JsonDocument.Parse(json); 2196var document = JsonDocument.Parse(json); 2325var document = JsonDocument.Parse(json);
Templating\DotNetTemplateFactoryTests.cs (1)
531public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
TestServices\TestDotNetCliRunner.cs (2)
20public Func<FileInfo, string[], string[], DotNetCliRunnerInvocationOptions, CancellationToken, (int ExitCode, JsonDocument? Output)>? GetProjectItemsAndPropertiesAsyncCallback { get; set; } 81public Task<(int ExitCode, JsonDocument? Output)> GetProjectItemsAndPropertiesAsync(FileInfo projectFile, string[] items, string[] properties, DotNetCliRunnerInvocationOptions options, CancellationToken cancellationToken)
Aspire.Dashboard (2)
Model\GenAI\GenAIMessages.cs (2)
211using var doc = JsonDocument.ParseValue(ref reader);
Aspire.Dashboard.Tests (7)
DashboardOptionsTests.cs (5)
318var jsonElement = JsonDocument.Parse(""" 346var jsonElement = JsonDocument.Parse(""" 375var jsonElement = JsonDocument.Parse(""" 411var jsonElement = JsonDocument.Parse(""" 450var jsonElement = JsonDocument.Parse("""
Model\GenAIItemPartViewModelTests.cs (2)
159["message"] = JsonDocument.Parse("""{"text":"こんにちは"}""").RootElement.GetProperty("text") 180["content"] = JsonDocument.Parse("""{"nested":"value"}""").RootElement
Aspire.Hosting (4)
Dcp\DcpLogParser.cs (2)
142using var doc = JsonDocument.Parse(jsonPart);
src\Shared\PackageUpdateHelpers.cs (2)
132using var document = JsonDocument.Parse(stdout);
Aspire.Hosting.DevTunnels (1)
DevTunnelCliClient.cs (1)
300output = JsonDocument.Parse(output).RootElement.GetProperty(propertyName).GetRawText();
Aspire.Hosting.JavaScript (2)
JavaScriptHostingExtensions.cs (2)
1222using var packageJson = JsonDocument.Parse(stream);
Aspire.Hosting.Maui (2)
Utilities\ProjectFileReader.cs (2)
85var jsonDoc = JsonDocument.Parse(output);
Aspire.Hosting.OpenAI (2)
OpenAIHealthCheck.cs (2)
91using var doc = await JsonDocument.ParseAsync(stream, cancellationToken: cts.Token).ConfigureAwait(false);
Aspire.Hosting.PostgreSQL.Tests (2)
AddPostgresTests.cs (2)
508var document = JsonDocument.Parse(serversFile.Contents!);
Aspire.Hosting.Seq.Tests (2)
SeqFunctionalTests.cs (2)
62var jsonDocument = JsonDocument.Parse(reponseContent);
Aspire.Hosting.Tests (29)
Backchannel\JsonElementConversionTests.cs (22)
27var json = JsonDocument.Parse("\"hello\""); 36var json = JsonDocument.Parse("42"); 46var json = JsonDocument.Parse("3.14"); 55var json = JsonDocument.Parse("true"); 64var json = JsonDocument.Parse("false"); 73var json = JsonDocument.Parse("null"); 82var json = JsonDocument.Parse("[1, 2, 3]"); 95var json = JsonDocument.Parse("""{"name": "test", "value": 123}"""); 106var json = JsonDocument.Parse("""{"outer": {"inner": "value"}}"""); 117var json = JsonDocument.Parse("""["text", 42, true, null]"""); 132var json = JsonDocument.Parse("""
Helpers\JsonDocumentManifestPublisher.cs (6)
31_manifestDocument = await JsonDocument.ParseAsync(stream, cancellationToken: cancellationToken).ConfigureAwait(false); 34private JsonDocument? _manifestDocument; 36public JsonDocument ManifestDocument 50private JsonDocument? _manifestDocument; 52public JsonDocument ManifestDocument 89manifestStore.ManifestDocument = await JsonDocument.ParseAsync(stream, cancellationToken: context.CancellationToken).ConfigureAwait(false);
Schema\SchemaTests.cs (1)
247var manifestDocument = manifestStore.ManifestDocument;
Aspire.Templates.Tests (2)
LocalhostTldHostnameTests.cs (2)
67using var launchSettings = JsonDocument.Parse(launchSettingsContent);
dotnet (9)
Commands\Run\CSharpCompilerCommand.cs (2)
358using var jsonDoc = JsonDocument.Parse(stream);
NugetSearch\AuthorsConverter.cs (2)
22var doc = JsonDocument.ParseValue(ref reader);
RuntimeConfig.cs (2)
24using (JsonDocument doc = JsonDocument.Parse(stream, jsonDocumentOptions))
SlnFileFactory.cs (1)
97JsonElement root = JsonDocument.Parse(File.ReadAllText(filteredSolutionPath), options).RootElement;
ToolManifest\ToolManifestEditor.cs (2)
139using (JsonDocument doc = JsonDocument.Parse(jsonStream))
dotnet-sourcelink (1)
dotnet-user-jwts (2)
Helpers\DevJwtCliHelpers.cs (2)
82var launchSettingsJson = JsonDocument.Parse(launchSettingsFileStream);
ILCompiler.Compiler (2)
src\runtime\src\coreclr\tools\Common\Microsoft\SourceLink\Tools\SourceLinkMap.cs (2)
64using var jsonDocument = JsonDocument.Parse(json, new JsonDocumentOptions() { AllowTrailingCommas = true });
ILCompiler.ReadyToRun (2)
Compiler\CallChainProfile.cs (2)
250using (JsonDocument document = JsonDocument.Parse(stream.BaseStream))
Infrastructure.Tests (12)
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (8)
151var document = JsonDocument.Parse(json); 178var document = JsonDocument.Parse(json); 209var document = JsonDocument.Parse(json); 665var document = JsonDocument.Parse(json);
PowerShellScripts\SplitTestMatrixByDepsTests.cs (2)
324var document = JsonDocument.Parse(json);
PowerShellScripts\SplitTestProjectsTests.cs (2)
120var document = JsonDocument.Parse(json); // Throws if invalid
Microsoft.AspNetCore.Authentication (1)
JsonDocumentAuthExtensions.cs (1)
9/// Authentication extensions to <see cref="JsonDocument"/>.
Microsoft.AspNetCore.Authentication.OAuth (8)
OAuthHandler.cs (4)
227true => OAuthTokenResponse.Success(JsonDocument.Parse(body)), 234var exception = OAuthTokenResponse.GetStandardErrorException(JsonDocument.Parse(body)); 254using (var user = JsonDocument.Parse("{}"))
OAuthTokenResponse.cs (4)
18private OAuthTokenResponse(JsonDocument response) 39public static OAuthTokenResponse Success(JsonDocument response) 63public JsonDocument? Response { get; set; } 93internal static Exception? GetStandardErrorException(JsonDocument response)
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Infrastructure\DefaultTempDataSerializer.cs (2)
20using var jsonDocument = JsonDocument.Parse(value);
Microsoft.Build (2)
Construction\Solution\SolutionFile.cs (2)
671JsonDocument text = JsonDocument.Parse(FileSystems.Default.ReadFileAllText(solutionFilterFile), options);
Microsoft.CodeAnalysis.Features (2)
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
148options = symbol.ContainingType.Name == nameof(JsonDocument) ? JsonOptions.Strict : default;
PdbSourceDocument\SourceLinkMap.cs (1)
72var root = JsonDocument.Parse(json, new JsonDocumentOptions() { AllowTrailingCommas = true }).RootElement;
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\SolutionFileReader.SolutionFilterReader.cs (2)
27using var document = JsonDocument.Parse(File.ReadAllText(filterFilename));
Microsoft.Deployment.DotNet.Releases (4)
Product.cs (2)
238using var releasesDocument = await JsonDocument.ParseAsync(stream).ConfigureAwait(false);
ProductCollection.cs (2)
115using var releasesIndexDocument = await JsonDocument.ParseAsync(stream).ConfigureAwait(false);
Microsoft.DotNet.Arcade.Sdk (2)
src\InstallDotNetCore.cs (2)
54using (JsonDocument jsonDocument = JsonDocument.Parse(bytes))
Microsoft.DotNet.ProjectTools (2)
LaunchSettings\LaunchSettings.cs (2)
86using (var document = JsonDocument.Parse(launchSettingsJsonContents, jsonDocumentOptions))
Microsoft.Extensions.AI (1)
ChatCompletion\ChatResponse{T}.cs (1)
139if (JsonDocument.Parse(json!).RootElement.TryGetProperty("data", out var data))
Microsoft.Extensions.AI.Abstractions (8)
Functions\AIFunctionFactory.cs (7)
82/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 155/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 240/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 320/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 378/// <see cref="JsonDocument"/>, or <see cref="JsonNode"/>, it is deserialized directly. If the argument is anything else unknown, 418/// invocation directly if the object is already of a compatible type. Otherwise, if the argument is a <see cref="JsonElement"/>, <see cref="JsonDocument"/>, 844JsonDocument doc => JsonSerializer.Deserialize(doc, typeInfo),
Utilities\AIJsonUtilities.Defaults.cs (1)
84[JsonSerializable(typeof(JsonDocument))]
Microsoft.Extensions.AI.Abstractions.Tests (37)
ChatCompletion\ChatResponseFormatTests.cs (1)
17private static JsonElement EmptySchema => JsonDocument.Parse("{}").RootElement;
Contents\FunctionCallContentTests.cs (2)
236var arguments = JsonSerializer.Deserialize<Dictionary<string, JsonDocument>>(""" 278AIFunctionArguments arguments = new(JsonSerializer.Deserialize<Dictionary<string, JsonDocument>>("""
test\Shared\JsonSchemaExporter\TestTypes.cs (5)
101yield return new TestData<JsonDocument>(JsonDocument.Parse("""[{ "x" : 42 }]"""), "true"); 102yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 118yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true"); 1245[JsonSerializable(typeof(JsonDocument))]
TestJsonSerializerContext.cs (1)
31[JsonSerializable(typeof(Dictionary<string, JsonDocument>))] // Used in Content tests
Utilities\AIJsonSchemaTransformCacheTests.cs (1)
64JsonElement schema = JsonDocument.Parse("{}").RootElement;
Utilities\AIJsonUtilitiesTests.cs (27)
152JsonElement expected = JsonDocument.Parse(""" 182JsonElement expected = JsonDocument.Parse(""" 197JsonElement expected = JsonDocument.Parse(""" 246JsonElement expected = JsonDocument.Parse(""" 322JsonElement expected = JsonDocument.Parse($$""" 388JsonElement expected = JsonDocument.Parse($$""" 416using JsonDocument expectedSchema = JsonDocument.Parse(""" 559using JsonDocument doc = JsonDocument.Parse(schema.GetRawText()); 578using JsonDocument doc = JsonDocument.Parse(schema.GetRawText()); 640JsonElement expectedSchema = JsonDocument.Parse(""" 1135JsonElement expectedSchema = JsonDocument.Parse(""" 1394JsonElement schema = JsonDocument.Parse(""" 1405JsonElement expectedSchema = JsonDocument.Parse(""" 1428JsonElement schema = JsonDocument.Parse(""" 1439JsonElement expectedSchema = JsonDocument.Parse(""" 1462JsonElement schema = JsonDocument.Parse(""" 1473JsonElement expectedSchema = JsonDocument.Parse(""" 1497JsonElement schema = JsonDocument.Parse(""" 1509JsonElement expectedSchema = JsonDocument.Parse(""" 1534JsonElement schema = JsonDocument.Parse(""" 1542JsonElement expectedSchema = JsonDocument.Parse(""" 1625JsonElement schema = JsonDocument.Parse("{}").RootElement; 1638JsonElement schema = JsonDocument.Parse(invalidSchema).RootElement; 1650JsonElement schema = JsonDocument.Parse(booleanSchema).RootElement;
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
SerializationChainingTests.cs (1)
37{ "data", JsonDocument.Parse("{\"some\":\"data\"}").RootElement },
Microsoft.Extensions.AI.Evaluation.Safety (10)
ContentSafetyService.cs (10)
55using JsonDocument annotationResponseDocument = JsonDocument.Parse(annotationResponse); 66using JsonDocument metricDetailsDocument = JsonDocument.Parse(metricDetails); 224using JsonDocument document = JsonDocument.Parse(responseContent); 276using JsonDocument document = JsonDocument.Parse(responseContent); 333using JsonDocument document = JsonDocument.Parse(responseContent);
Microsoft.Extensions.AI.OpenAI.Tests (5)
OpenAIConversionTests.cs (5)
113var jsonSchema = JsonDocument.Parse(""" 143using var parsedParams = JsonDocument.Parse(tool.FunctionParameters); 622using var jsonDoc = JsonDocument.Parse(parameters);
Microsoft.Extensions.AI.Tests (9)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (2)
38AssertDeepEquals(JsonDocument.Parse(""" 375AssertDeepEquals(JsonDocument.Parse("""
Functions\AIFunctionFactoryTest.cs (6)
136["z"] = JsonDocument.Parse("3"), 137["w"] = JsonDocument.Parse("4").RootElement, 160JsonElement expectedResult = JsonDocument.Parse(jsonStringParam, new() { CommentHandling = JsonCommentHandling.Skip }).RootElement; 180JsonElement expectedResult = JsonDocument.Parse(JsonSerializer.Serialize(invalidJsonParam, JsonContext.Default.String)).RootElement; 1004JsonElement expectedSchema = JsonDocument.Parse(""" 1037JsonElement expectedSchema = JsonDocument.Parse("""
TestJsonSerializerContext.cs (1)
22[JsonSerializable(typeof(Dictionary<string, JsonDocument>))]
Microsoft.Extensions.Configuration.Json (2)
JsonConfigurationFileParser.cs (2)
31using (JsonDocument doc = JsonDocument.Parse(reader.ReadToEnd(), jsonDocumentOptions))
Microsoft.ML.Tokenizers.Tests (2)
BpeTests.cs (2)
955using JsonDocument doc = JsonDocument.Parse(json);
Microsoft.NET.Build.Containers (3)
LocalDaemons\DockerCli.cs (3)
156JsonDocument config = GetDockerConfig(); 200internal static JsonDocument GetDockerConfig() 224return JsonDocument.Parse(dockerCommandResult.StdOut ?? string.Empty);
Microsoft.NET.HostModel (1)
ComHost\RegFreeComManifest.cs (1)
60clsidMap = JsonDocument.Parse(clsidMapStream).RootElement;
Microsoft.SourceLink.Tools.Package (1)
SourceLinkMap.cs (1)
92var root = JsonDocument.Parse(json, new JsonDocumentOptions() { AllowTrailingCommas = true }).RootElement;
Microsoft.TemplateEngine.Edge (6)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (6)
234/// <see cref="JsonDocument"/>, which supports duplicate keys (last-wins semantics, like Newtonsoft.Json). 252/// <see cref="JsonDocument"/>, which tolerates duplicate keys. 265using JsonDocument doc = JsonDocument.Parse(json, DocOptions); 549using JsonDocument doc = JsonDocument.Parse(json, DocOptions);
Microsoft.TemplateEngine.Utils (6)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (6)
234/// <see cref="JsonDocument"/>, which supports duplicate keys (last-wins semantics, like Newtonsoft.Json). 252/// <see cref="JsonDocument"/>, which tolerates duplicate keys. 265using JsonDocument doc = JsonDocument.Parse(json, DocOptions); 549using JsonDocument doc = JsonDocument.Parse(json, DocOptions);
Microsoft.TemplateSearch.Common (6)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (6)
234/// <see cref="JsonDocument"/>, which supports duplicate keys (last-wins semantics, like Newtonsoft.Json). 252/// <see cref="JsonDocument"/>, which tolerates duplicate keys. 265using JsonDocument doc = JsonDocument.Parse(json, DocOptions); 549using JsonDocument doc = JsonDocument.Parse(json, DocOptions);
Microsoft.TestPlatform.CommunicationUtilities (41)
JsonDataSerializer.Stj.cs (4)
87using var doc = JsonDocument.Parse(rawMessage); 111using var doc = JsonDocument.Parse(message.RawMessage!);
Serialization\AfterTestRunEndResultConverter.cs (2)
31using var doc = JsonDocument.ParseValue(ref reader);
Serialization\AttachmentConverters.cs (4)
22using var doc = JsonDocument.ParseValue(ref reader); 62using var doc = JsonDocument.ParseValue(ref reader);
Serialization\DiscoveryCriteriaConverter.cs (2)
30using var doc = JsonDocument.ParseValue(ref reader);
Serialization\ExceptionConverter.cs (2)
34using var doc = JsonDocument.ParseValue(ref reader);
Serialization\ObjectConverter.cs (1)
36_ => JsonDocument.ParseValue(ref reader).RootElement.Clone(),
Serialization\TestCaseConverter.cs (2)
25using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestCaseConverterV2.cs (2)
26using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestExecutionContextConverter.cs (2)
23using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestObjectBaseConverter.cs (2)
60using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestObjectConverter.cs (2)
38using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestProcessAttachDebuggerPayloadConverter.cs (2)
28using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestPropertyConverter.cs (2)
28using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestResultConverter.cs (2)
23using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestResultConverterV2.cs (2)
25using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestRunChangedEventArgsConverter.cs (2)
30using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestRunCompleteEventArgsConverter.cs (2)
31using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestRunStatisticsConverter.cs (2)
26using var doc = JsonDocument.ParseValue(ref reader);
Serialization\TestSessionInfoConverter.cs (2)
28using var doc = JsonDocument.ParseValue(ref reader);
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
Hosting\DotnetTestHostManager.cs (2)
957using var doc = JsonDocument.Parse(stream);
rzc (2)
Json\ObjectJsonConverter`1.cs (2)
24using var doc = JsonDocument.ParseValue(ref reader);
Shared.Tests (5)
JsonSchemaExporter\TestTypes.cs (5)
101yield return new TestData<JsonDocument>(JsonDocument.Parse("""[{ "x" : 42 }]"""), "true"); 102yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 118yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true"); 1245[JsonSerializable(typeof(JsonDocument))]
System.Text.Json (156)
System\Runtime\InteropServices\JsonMarshal.cs (4)
18/// <exception cref="ObjectDisposedException">The underlying <see cref="JsonDocument"/> has been disposed.</exception> 20/// While the method itself does check for disposal of the underlying <see cref="JsonDocument"/>, 35/// <exception cref="ObjectDisposedException">The underlying <see cref="JsonDocument"/> has been disposed.</exception> 38/// While the method itself does check for disposal of the underlying <see cref="JsonDocument"/>,
System\Text\Json\Document\JsonDocument.cs (4)
102/// The parent <see cref="JsonDocument"/> has been disposed. 718JsonDocument newDocument = 1035private static void ValidateNoDuplicateProperties(JsonDocument document) 1043private static void ValidateDuplicatePropertiesCore(JsonDocument document)
System\Text\Json\Document\JsonDocument.Parse.cs (27)
16private static JsonDocument? s_nullLiteral; 17private static JsonDocument? s_trueLiteral; 18private static JsonDocument? s_falseLiteral; 47public static JsonDocument Parse(ReadOnlyMemory<byte> utf8Json, JsonDocumentOptions options = default) 77public static JsonDocument Parse(ReadOnlySequence<byte> utf8Json, JsonDocumentOptions options = default) 122public static JsonDocument Parse(Stream utf8Json, JsonDocumentOptions options = default) 145internal static JsonDocument ParseRented(PooledByteBufferWriter utf8Json, JsonDocumentOptions options = default) 155internal static JsonDocument ParseValue(Stream utf8Json, JsonDocumentOptions options) 175internal static JsonDocument ParseValue(ReadOnlySpan<byte> utf8Json, JsonDocumentOptions options) 186internal static JsonDocument ParseValue(string json, JsonDocumentOptions options) 208public static Task<JsonDocument> ParseAsync( 218private static async Task<JsonDocument> ParseAsyncCore( 242internal static async Task<JsonDocument> ParseAsyncCoreUnrented( 282public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlyMemory<char> json, JsonDocumentOptions options = default) 308internal static JsonDocument ParseValue(ReadOnlySpan<char> json, JsonDocumentOptions options) 349public static JsonDocument Parse([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonDocumentOptions options = default) 394public static bool TryParseValue(ref Utf8JsonReader reader, [NotNullWhen(true)] out JsonDocument? document) 434public static JsonDocument ParseValue(ref Utf8JsonReader reader) => 437internal static JsonDocument ParseValue(ref Utf8JsonReader reader, bool allowDuplicateProperties) 439bool ret = TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: true, allowDuplicateProperties); 448[NotNullWhen(true)] out JsonDocument? document, 692private static JsonDocument CreateForLiteral(JsonTokenType tokenType) 708JsonDocument Create(byte[] utf8Json) 716private static JsonDocument Parse( 726JsonDocument document; 753private static JsonDocument ParseUnrented( 789JsonDocument document = new JsonDocument(utf8Json, database, isDisposable: false);
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (1)
70internal void AddPropertyName(JsonProperty property, JsonDocument document)
System\Text\Json\Document\JsonDocumentOptions.cs (1)
9/// Provides the ability for the user to define custom behavior when parsing JSON to create a <see cref="JsonDocument"/>.
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
91_curIdx = _target._idx + JsonDocument.DbRow.Size;
System\Text\Json\Document\JsonElement.cs (53)
15/// Represents a specific JSON value within a <see cref="JsonDocument"/>. 20private readonly JsonDocument _parent; 23internal JsonElement(JsonDocument parent, int idx) 46/// The parent <see cref="JsonDocument"/> has been disposed. 61/// The parent <see cref="JsonDocument"/> has been disposed. 81/// The parent <see cref="JsonDocument"/> has been disposed. 98/// The parent <see cref="JsonDocument"/> has been disposed. 132/// The parent <see cref="JsonDocument"/> has been disposed. 172/// The parent <see cref="JsonDocument"/> has been disposed. 211/// The parent <see cref="JsonDocument"/> has been disposed. 251/// The parent <see cref="JsonDocument"/> has been disposed. 286/// The parent <see cref="JsonDocument"/> has been disposed. 322/// The parent <see cref="JsonDocument"/> has been disposed. 343/// The parent <see cref="JsonDocument"/> has been disposed. 374/// The parent <see cref="JsonDocument"/> has been disposed. 399/// The parent <see cref="JsonDocument"/> has been disposed. 422/// The parent <see cref="JsonDocument"/> has been disposed. 450/// The parent <see cref="JsonDocument"/> has been disposed. 471/// The parent <see cref="JsonDocument"/> has been disposed. 499/// The parent <see cref="JsonDocument"/> has been disposed. 522/// The parent <see cref="JsonDocument"/> has been disposed. 549/// The parent <see cref="JsonDocument"/> has been disposed. 569/// The parent <see cref="JsonDocument"/> has been disposed. 596/// The parent <see cref="JsonDocument"/> has been disposed. 620/// The parent <see cref="JsonDocument"/> has been disposed. 648/// The parent <see cref="JsonDocument"/> has been disposed. 668/// The parent <see cref="JsonDocument"/> has been disposed. 695/// The parent <see cref="JsonDocument"/> has been disposed. 719/// The parent <see cref="JsonDocument"/> has been disposed. 747/// The parent <see cref="JsonDocument"/> has been disposed. 770/// The parent <see cref="JsonDocument"/> has been disposed. 797/// The parent <see cref="JsonDocument"/> has been disposed. 821/// The parent <see cref="JsonDocument"/> has been disposed. 858/// The parent <see cref="JsonDocument"/> has been disposed. 889/// The parent <see cref="JsonDocument"/> has been disposed. 925/// The parent <see cref="JsonDocument"/> has been disposed. 956/// The parent <see cref="JsonDocument"/> has been disposed. 983/// The parent <see cref="JsonDocument"/> has been disposed. 1007/// The parent <see cref="JsonDocument"/> has been disposed. 1035/// The parent <see cref="JsonDocument"/> has been disposed. 1058/// The parent <see cref="JsonDocument"/> has been disposed. 1086/// The parent <see cref="JsonDocument"/> has been disposed. 1109/// The parent <see cref="JsonDocument"/> has been disposed. 1137/// The parent <see cref="JsonDocument"/> has been disposed. 1160/// The parent <see cref="JsonDocument"/> has been disposed. 1194/// The parent <see cref="JsonDocument"/> has been disposed. 1544/// The parent <see cref="JsonDocument"/> has been disposed. 1572/// The parent <see cref="JsonDocument"/> has been disposed. 1598/// The parent <see cref="JsonDocument"/> has been disposed. 1619/// For JsonElement built from <see cref="JsonDocument"/>: 1646/// The parent <see cref="JsonDocument"/> has been disposed. 1680/// original <see cref="JsonDocument"/>. 1684/// original <see cref="JsonDocument"/>.
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (2)
96_curIdx = _target._idx + JsonDocument.DbRow.Size; 104_curIdx += JsonDocument.DbRow.Size;
System\Text\Json\Document\JsonElement.Parse.cs (14)
49bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: true, useArrayPools: false); 58bool ret = JsonDocument.TryParseValue( 60out JsonDocument? document, 72JsonDocument document = JsonDocument.ParseValue(utf8Json, options); 86JsonDocument document = JsonDocument.ParseValue(utf8Json, options); 100JsonDocument document = JsonDocument.ParseValue(json, options); 117JsonDocument document = JsonDocument.ParseValue(json, options); 161bool ret = JsonDocument.TryParseValue(ref reader, out JsonDocument? document, shouldThrow: false, useArrayPools: false);
System\Text\Json\Document\JsonProperty.cs (1)
113/// The parent <see cref="JsonDocument"/> has been disposed.
System\Text\Json\Nodes\JsonNode.Parse.cs (2)
148JsonDocument document = await JsonDocument.ParseAsyncCoreUnrented(utf8Json, documentOptions, cancellationToken).ConfigureAwait(false);
System\Text\Json\Nodes\JsonValue.cs (4)
114JsonElement thisElement = ToJsonElement(this, out JsonDocument? thisDocument); 115JsonElement otherElement = ToJsonElement(otherNode, out JsonDocument? otherDocument); 126static JsonElement ToJsonElement(JsonNode node, out JsonDocument? backingDocument) 144backingDocument = JsonDocument.ParseValue(ref reader);
System\Text\Json\Serialization\Converters\Value\JsonDocumentConverter.cs (4)
9internal sealed class JsonDocumentConverter : JsonConverter<JsonDocument?> 13public override JsonDocument Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => 14JsonDocument.ParseValue(ref reader, options.AllowDuplicateProperties); 16public override void Write(Utf8JsonWriter writer, JsonDocument? value, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (15)
13/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <typeparamref name="TValue"/>. 17/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 31public static TValue? Deserialize<TValue>(this JsonDocument document, JsonSerializerOptions? options = null) 41/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <paramref name="returnType"/>. 44/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 59public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerOptions? options = null) 70/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <typeparamref name="TValue"/>. 74/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 86public static TValue? Deserialize<TValue>(this JsonDocument document, JsonTypeInfo<TValue> jsonTypeInfo) 97/// Converts the <see cref="JsonDocument"/> representing a single JSON value into an instance specified by the <paramref name="jsonTypeInfo"/>. 99/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 109public static object? Deserialize(this JsonDocument document, JsonTypeInfo jsonTypeInfo) 120/// Converts the <see cref="JsonDocument"/> representing a single JSON value into a <paramref name="returnType"/>. 123/// <param name="document">The <see cref="JsonDocument"/> to convert.</param> 155public static object? Deserialize(this JsonDocument document, Type returnType, JsonSerializerContext context)
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (19)
14/// Converts the provided value into a <see cref="JsonDocument"/>. 17/// <returns>A <see cref="JsonDocument"/> representation of the JSON value.</returns> 26public static JsonDocument SerializeToDocument<TValue>(TValue value, JsonSerializerOptions? options = null) 33/// Converts the provided value into a <see cref="JsonDocument"/>. 35/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 51public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerOptions? options = null) 59/// Converts the provided value into a <see cref="JsonDocument"/>. 62/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 68public static JsonDocument SerializeToDocument<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 77/// Converts the provided value into a <see cref="JsonDocument"/>. 79/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 88public static JsonDocument SerializeToDocument(object? value, JsonTypeInfo jsonTypeInfo) 97/// Converts the provided value into a <see cref="JsonDocument"/>. 99/// <returns>A <see cref="JsonDocument"/> representation of the value.</returns> 114public static JsonDocument SerializeToDocument(object? value, Type inputType, JsonSerializerContext context) 122private static JsonDocument WriteDocument<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 135return JsonDocument.ParseRented(output, options.GetDocumentOptions()); 143private static JsonDocument WriteDocumentAsObject(object? value, JsonTypeInfo jsonTypeInfo) 156return JsonDocument.ParseRented(output, options.GetDocumentOptions());
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
168/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonDocument"/> values. 171public static JsonConverter<JsonDocument?> JsonDocumentConverter => s_jsonDocumentConverter ??= new JsonDocumentConverter(); 172private static JsonConverter<JsonDocument?>? s_jsonDocumentConverter;
System\Text\Json\ThrowHelper.cs (1)
756throw new ObjectDisposedException(nameof(JsonDocument));