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)
458
jsonTypeInfo.
PolymorphismOptions
= null;
23 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.OpenApi (6)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (1)
229
=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.
PolymorphismOptions
is not null;
Extensions\JsonNodeSchemaExtensions.cs (3)
432
if (context.TypeInfo.
PolymorphismOptions
is { } polymorphismOptions && context.BaseTypeInfo == null)
511
&& context.TypeInfo.
PolymorphismOptions
is { } polymorphismOptions
523
&& context.TypeInfo.
PolymorphismOptions
is { } polymorphismOptions
Services\Schemas\OpenApiSchemaService.cs (2)
532
if (schema.AnyOf is { Count: > 0 } && jsonTypeInfo.
PolymorphismOptions
is not null)
535
foreach (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.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
699
typeInfo.
PolymorphismOptions
!.DerivedTypes.Add(new JsonDerivedType(t, t.Name));
System.Text.Json (11)
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
88
if (parentPolymorphicTypeInfo is null && typeInfo.
PolymorphismOptions
is { DerivedTypes.Count: > 0 } polyOptions)
506
Debug.Assert(typeInfo.
PolymorphismOptions
is not null);
508
foreach (JsonDerivedType derivedType in typeInfo.
PolymorphismOptions
.DerivedTypes)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
177
if (typeInfo.
PolymorphismOptions
is not null &&
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (4)
993
if (
PolymorphismOptions
is not null)
997
PolymorphicTypeResolver = new PolymorphicTypeResolver(Options,
PolymorphismOptions
, Type, Converter.CanHaveMetadata);
1089
Debug.Assert(Kind is JsonTypeInfoKind.Union ||
PolymorphismOptions
is not null);
1114
JsonPolymorphismOptions? polymorphismOptions =
PolymorphismOptions
;
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (3)
280
if (typeInfo.
PolymorphismOptions
is not null)
292
if (candidateInfo?.
PolymorphismOptions
is not null)
304
if (candidateInfo?.
PolymorphismOptions
is not null)