2 writes to PolymorphismOptions
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.cs (1)
201(typeInfo.PolymorphismOptions ??= new()).DerivedTypes.Add(new(contentType, typeDiscriminatorId));
System.Text.Json (1)
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (1)
458jsonTypeInfo.PolymorphismOptions = null;
17 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)
1391=> 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.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.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
699typeInfo.PolymorphismOptions!.DerivedTypes.Add(new JsonDerivedType(t, t.Name));
System.Text.Json (11)
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
87if (parentPolymorphicTypeInfo is null && typeInfo.PolymorphismOptions is { DerivedTypes.Count: > 0 } polyOptions) 456Debug.Assert(typeInfo.PolymorphismOptions is not null); 458foreach (JsonDerivedType derivedType in typeInfo.PolymorphismOptions.DerivedTypes)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
107if (typeInfo.PolymorphismOptions is not null &&
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (4)
1004if (PolymorphismOptions != null) 1008PolymorphicTypeResolver = new PolymorphicTypeResolver(Options, PolymorphismOptions, Type, Converter.CanHaveMetadata); 1100Debug.Assert(Kind is JsonTypeInfoKind.Union || PolymorphismOptions is not null); 1125JsonPolymorphismOptions? polymorphismOptions = PolymorphismOptions;
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (3)
280if (typeInfo.PolymorphismOptions != null) 292if (candidateInfo?.PolymorphismOptions != null) 304if (candidateInfo?.PolymorphismOptions != null)