| File: Generated\361d1da7f942c932\TestTypesContext.ClassWithPropertiesUsingCustomConverters.g.cs | |
| Project: ..\..\..\test\Shared\Shared.Tests.csproj (Shared.Tests) |
// <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.ClassWithPropertiesUsingCustomConverters>? _ClassWithPropertiesUsingCustomConverters; /// <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.ClassWithPropertiesUsingCustomConverters> ClassWithPropertiesUsingCustomConverters #nullable enable annotations { get => _ClassWithPropertiesUsingCustomConverters ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)); } private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters> Create_ClassWithPropertiesUsingCustomConverters(global::System.Text.Json.JsonSerializerOptions options) { if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters> jsonTypeInfo)) { var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters> { ObjectCreator = () => new global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters(), ObjectWithParameterizedConstructorCreator = null, PropertyMetadataInitializer = _ => ClassWithPropertiesUsingCustomConvertersPropInit(options), ConstructorParameterMetadataInitializer = null, ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null), SerializeHandler = ClassWithPropertiesUsingCustomConvertersSerializeHandler, }; jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters>(options, objectInfo); jsonTypeInfo.NumberHandling = null; } jsonTypeInfo.OriginatingResolver = this; return jsonTypeInfo; } private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ClassWithPropertiesUsingCustomConvertersPropInit(global::System.Text.Json.JsonSerializerOptions options) { var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[2]; var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter1> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)obj).Prop1, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)obj).Prop1 = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Prop1", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters).GetProperty("Prop1", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter1), global::System.Array.Empty<global::System.Type>(), null), }; properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter1>(options, info0); var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter2> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)obj).Prop2, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)obj).Prop2 = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Prop2", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters).GetProperty("Prop2", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter2), global::System.Array.Empty<global::System.Type>(), null), }; properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter2>(options, info1); properties[1].Order = 1; 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 ClassWithPropertiesUsingCustomConvertersSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters? value) { if (value is null) { writer.WriteNullValue(); return; } writer.WriteStartObject(); writer.WritePropertyName(PropName_Prop1); global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)value).Prop1, ClassWithCustomConverter1); writer.WritePropertyName(PropName_Prop2); global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.JsonSchemaExporter.TestTypes.ClassWithPropertiesUsingCustomConverters)value).Prop2, ClassWithCustomConverter2); writer.WriteEndObject(); } } } }