// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Microsoft.Extensions.AI.JsonSchemaExporter
{
public static partial class TestTypes
{
public partial class TestTypesContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences>? _PocoWithNonRecursiveDuplicateOccurrences;
/// <summary>
/// Defines the source generated JSON serialization contract metadata for a given type.
/// </summary>
#nullable disable annotations // Marking the property type as nullable-oblivious.
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences> PocoWithNonRecursiveDuplicateOccurrences
#nullable enable annotations
{
get => _PocoWithNonRecursiveDuplicateOccurrences ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences> Create_PocoWithNonRecursiveDuplicateOccurrences(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences>
{
ObjectCreator = () => new global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences(),
ObjectWithParameterizedConstructorCreator = null,
PropertyMetadataInitializer = _ => PocoWithNonRecursiveDuplicateOccurrencesPropInit(options),
ConstructorParameterMetadataInitializer = null,
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
SerializeHandler = PocoWithNonRecursiveDuplicateOccurrencesSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] PocoWithNonRecursiveDuplicateOccurrencesPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[4];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).Value1,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).Value1 = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Value1",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences).GetProperty("Value1", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).Value2,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).Value2 = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Value2",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences).GetProperty("Value2", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>(options, info1);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).ListValue,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).ListValue = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ListValue",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences).GetProperty("ListValue", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.List<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord>>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord[]>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).ArrayValue,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)obj).ArrayValue = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ArrayValue",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences).GetProperty("ArrayValue", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord[]), global::System.Array.Empty<global::System.Type>(), null),
};
properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.SimpleRecord[]>(options, info3);
return properties;
}
// Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
// methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
private void PocoWithNonRecursiveDuplicateOccurrencesSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WritePropertyName(PropName_Value1);
SimpleRecordSerializeHandler(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)value).Value1);
writer.WritePropertyName(PropName_Value2);
SimpleRecordSerializeHandler(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)value).Value2);
writer.WritePropertyName(PropName_ListValue);
ListSimpleRecordSerializeHandler(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)value).ListValue);
writer.WritePropertyName(PropName_ArrayValue);
SimpleRecordArraySerializeHandler(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.PocoWithNonRecursiveDuplicateOccurrences)value).ArrayValue);
writer.WriteEndObject();
}
}
}
}