JsonSchemaExporterContext
Defines the context for the generated JSON schema for a particular node in a type graph.
using System.Runtime.CompilerServices;
using System.Text.Json.Serialization.Metadata;
namespace System.Text.Json.Schema
{
[System.Runtime.CompilerServices.NullableContext(2)]
[System.Runtime.CompilerServices.Nullable(0)]
public readonly struct JsonSchemaExporterContext
{
internal readonly string[] _path;
[System.Runtime.CompilerServices.Nullable(1)]
public JsonTypeInfo TypeInfo {
[System.Runtime.CompilerServices.NullableContext(1)]
get;
}
public JsonPropertyInfo PropertyInfo { get; }
public JsonTypeInfo BaseTypeInfo { get; }
[System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
public ReadOnlySpan<string> Path {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
get {
return _path;
}
}
internal JsonSchemaExporterContext(JsonTypeInfo typeInfo, JsonPropertyInfo propertyInfo, JsonTypeInfo baseTypeInfo, string[] path)
{
TypeInfo = typeInfo;
PropertyInfo = propertyInfo;
BaseTypeInfo = baseTypeInfo;
_path = path;
}
}
}