2 writes to PolymorphismOptions
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.cs (1)
214(typeInfo.PolymorphismOptions ??= new()).DerivedTypes.Add(new(contentType, typeDiscriminatorId));
System.Text.Json (1)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (1)
458jsonTypeInfo.PolymorphismOptions = null;
32 references to PolymorphismOptions
Microsoft.AspNetCore.Http.Extensions (1)
src\aspnetcore\src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.AspNetCore.Http.Results (1)
src\aspnetcore\src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.AspNetCore.Identity (1)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (1)
1485=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.AspNetCore.Mvc.Core (1)
src\aspnetcore\src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.AspNetCore.OpenApi (6)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (1)
229=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Extensions\JsonNodeSchemaExtensions.cs (3)
432if (context.TypeInfo.PolymorphismOptions is { } polymorphismOptions && context.BaseTypeInfo == null) 521&& context.TypeInfo.PolymorphismOptions is { } polymorphismOptions 533&& context.TypeInfo.PolymorphismOptions is { } polymorphismOptions
Services\Schemas\OpenApiSchemaService.cs (2)
532if (schema.AnyOf is { Count: > 0 } && jsonTypeInfo.PolymorphismOptions is not null) 535foreach (var derivedType in jsonTypeInfo.PolymorphismOptions.DerivedTypes)
Microsoft.AspNetCore.Routing (1)
src\aspnetcore\src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
1316var derivedAIContentTypes = options.GetTypeInfo(typeof(DerivedAIContent)).PolymorphismOptions!.DerivedTypes; 1317var aiContentTypes = options.GetTypeInfo(typeof(AIContent)).PolymorphismOptions!.DerivedTypes; 1368var toolCallTypes = options.GetTypeInfo(typeof(ToolCallContent)).PolymorphismOptions!.DerivedTypes; 1369var aiContentTypes = options.GetTypeInfo(typeof(AIContent)).PolymorphismOptions!.DerivedTypes; 1407var aiContentDerivedTypes = options.GetTypeInfo(typeof(AIContent)).PolymorphismOptions!.DerivedTypes; 1408var derivedAIContentTypes = options.GetTypeInfo(typeof(DerivedAIContent)).PolymorphismOptions!.DerivedTypes; 1453var aiContentDerivedTypes = options.GetTypeInfo(typeof(AIContent)).PolymorphismOptions!.DerivedTypes; 1454var derivedAIContentTypes = options.GetTypeInfo(typeof(DerivedAIContent)).PolymorphismOptions!.DerivedTypes;
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
699typeInfo.PolymorphismOptions!.DerivedTypes.Add(new JsonDerivedType(t, t.Name));
System.Text.Json (12)
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
88if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions) 516Debug.Assert(typeInfo.PolymorphismOptions is not null); 518foreach (JsonDerivedType derivedType in typeInfo.PolymorphismOptions.DerivedTypes)
System\Text\Json\Serialization\JsonUnionTypeStructuralClassifier.cs (1)
184if (typeInfo.PolymorphismOptions is not null)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
177if (typeInfo.PolymorphismOptions is not null &&
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (4)
985if (PolymorphismOptions is not null) 989PolymorphicTypeResolver = new PolymorphicTypeResolver(Options, PolymorphismOptions, Type, Converter.CanHaveMetadata); 1081Debug.Assert(Kind is JsonTypeInfoKind.Union || PolymorphismOptions is not null); 1106JsonPolymorphismOptions? polymorphismOptions = PolymorphismOptions;
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (3)
280if (typeInfo.PolymorphismOptions is not null) 292if (candidateInfo?.PolymorphismOptions is not null) 304if (candidateInfo?.PolymorphismOptions is not null)