< Summary

Information
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 47
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%

File(s)

C:\h\w\B31A098C\w\BB5A0A33\e\runtime-utils\Runner\runtime\src\libraries\System.Text.Json\src\System\Text\Json\Schema\JsonSchemaExporterContext.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Text.Json.Serialization.Metadata;
 5
 6namespace System.Text.Json.Schema
 7{
 8    /// <summary>
 9    /// Defines the context for the generated JSON schema for a particular node in a type graph.
 10    /// </summary>
 11    public readonly struct JsonSchemaExporterContext
 12    {
 13        internal readonly string[] _path;
 14
 15        internal JsonSchemaExporterContext(
 16            JsonTypeInfo typeInfo,
 17            JsonPropertyInfo? propertyInfo,
 18            JsonTypeInfo? baseTypeInfo,
 19            string[] path)
 020        {
 021            TypeInfo = typeInfo;
 022            PropertyInfo = propertyInfo;
 023            BaseTypeInfo = baseTypeInfo;
 024            _path = path;
 025        }
 26
 27        /// <summary>
 28        /// The <see cref="JsonTypeInfo"/> for the type being processed.
 29        /// </summary>
 030        public JsonTypeInfo TypeInfo { get; }
 31
 32        /// <summary>
 33        /// The <see cref="JsonPropertyInfo"/> if the schema is being generated for a property.
 34        /// </summary>
 035        public JsonPropertyInfo? PropertyInfo { get; }
 36
 37        /// <summary>
 38        /// Gets the <see cref="JsonTypeInfo"/> for polymorphic base type if the schema is being generated for a derived
 39        /// </summary>
 040        public JsonTypeInfo? BaseTypeInfo { get; }
 41
 42        /// <summary>
 43        /// The path to the current node in the generated JSON schema.
 44        /// </summary>
 045        public ReadOnlySpan<string> Path => _path;
 46    }
 47}