70 instantiations of JsonDerivedType
FormatterWebSite (1)
Controllers\SystemTextJsonOutputFormatterController.cs (1)
31
[
JsonDerivedType
(typeof(DerivedModel), nameof(DerivedModel))]
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3539
[
JsonDerivedType
(typeof(JsonTodoChild), nameof(JsonTodoChild))]
RequestDelegateGenerator\SharedTypes.cs (1)
86
[
JsonDerivedType
(typeof(JsonTodoChild), nameof(JsonTodoChild))]
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (1)
86
[
JsonDerivedType
(typeof(JsonTodoChild), nameof(JsonTodoChild))]
Microsoft.AspNetCore.Http.Results.Tests (1)
HttpResultsHelperTests.cs (1)
281
[
JsonDerivedType
(typeof(TodoJsonChild), nameof(TodoJsonChild))]
Microsoft.AspNetCore.Mvc.Core.Test (1)
Formatters\SystemTextJsonOutputFormatterTest.cs (1)
304
[
JsonDerivedType
(typeof(JsonPersonExtended), nameof(JsonPersonExtended))]
Microsoft.AspNetCore.OpenApi.Tests (16)
Shared\SharedTypes.Polymorphism.cs (16)
7
[
JsonDerivedType
(typeof(Triangle), typeDiscriminator: "triangle")]
8
[
JsonDerivedType
(typeof(Square), typeDiscriminator: "square")]
25
[
JsonDerivedType
(typeof(WeatherForecastWithCity), 0)]
26
[
JsonDerivedType
(typeof(WeatherForecastWithTimeSeries), 1)]
27
[
JsonDerivedType
(typeof(WeatherForecastWithLocalNews), 2)]
48
[
JsonDerivedType
(typeof(Student), typeDiscriminator: "student")]
49
[
JsonDerivedType
(typeof(Teacher), typeDiscriminator: "teacher")]
66
[
JsonDerivedType
(typeof(PaintColor), typeDiscriminator: "paint")]
67
[
JsonDerivedType
(typeof(FabricColor), typeDiscriminator: "fabric")]
85
[
JsonDerivedType
(typeof(Cat), typeDiscriminator: "cat")]
86
[
JsonDerivedType
(typeof(Dog), typeDiscriminator: "dog")]
87
[
JsonDerivedType
(typeof(Pet), typeDiscriminator: "pet")]
105
[
JsonDerivedType
(typeof(Animal))]
106
[
JsonDerivedType
(typeof(Plant))]
123
[
JsonDerivedType
(typeof(Manager), typeDiscriminator: "manager")]
124
[
JsonDerivedType
(typeof(Employee), typeDiscriminator: "employee")]
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Internal\Protocol\JsonHubProtocolTests.cs (2)
232
[
JsonDerivedType
(typeof(JsonPersonExtended), nameof(JsonPersonExtended))]
233
[
JsonDerivedType
(typeof(JsonPersonExtended2), nameof(JsonPersonExtended2))]
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Protocol\WorkDoneProgress.cs (3)
16
[
JsonDerivedType
(typeof(WorkDoneProgressBegin), "begin")]
17
[
JsonDerivedType
(typeof(WorkDoneProgressReport), "report")]
18
[
JsonDerivedType
(typeof(WorkDoneProgressEnd), "end")]
Microsoft.Extensions.AI.Abstractions (15)
ChatCompletion\ChatResponseFormat.cs (2)
11
[
JsonDerivedType
(typeof(ChatResponseFormatText), typeDiscriminator: "text")]
12
[
JsonDerivedType
(typeof(ChatResponseFormatJson), typeDiscriminator: "json")]
ChatCompletion\ChatToolMode.cs (2)
16
[
JsonDerivedType
(typeof(AutoChatToolMode), typeDiscriminator: "auto")]
17
[
JsonDerivedType
(typeof(RequiredChatToolMode), typeDiscriminator: "required")]
Contents\AIContent.cs (7)
10
[
JsonDerivedType
(typeof(AudioContent), typeDiscriminator: "audio")]
11
[
JsonDerivedType
(typeof(DataContent), typeDiscriminator: "data")]
12
[
JsonDerivedType
(typeof(FunctionCallContent), typeDiscriminator: "functionCall")]
13
[
JsonDerivedType
(typeof(FunctionResultContent), typeDiscriminator: "functionResult")]
14
[
JsonDerivedType
(typeof(ImageContent), typeDiscriminator: "image")]
15
[
JsonDerivedType
(typeof(TextContent), typeDiscriminator: "text")]
16
[
JsonDerivedType
(typeof(UsageContent), typeDiscriminator: "usage")]
Embeddings\Embedding.cs (4)
15
[
JsonDerivedType
(typeof(Embedding<float>), typeDiscriminator: "floats")]
16
[
JsonDerivedType
(typeof(Embedding<double>), typeDiscriminator: "doubles")]
17
[
JsonDerivedType
(typeof(Embedding<byte>), typeDiscriminator: "bytes")]
18
[
JsonDerivedType
(typeof(Embedding<sbyte>), typeDiscriminator: "sbytes")]
Microsoft.Extensions.AI.Abstractions.Tests (6)
test\Shared\JsonSchemaExporter\TestTypes.cs (6)
1073
[
JsonDerivedType
(typeof(DerivedPocoNoDiscriminator))]
1074
[
JsonDerivedType
(typeof(DerivedPocoStringDiscriminator), "derivedPoco")]
1075
[
JsonDerivedType
(typeof(DerivedPocoIntDiscriminator), 42)]
1076
[
JsonDerivedType
(typeof(DerivedCollection), "derivedCollection")]
1077
[
JsonDerivedType
(typeof(DerivedDictionary), "derivedDictionary")]
1116
[
JsonDerivedType
(typeof(NonAbstractClassWithSingleDerivedType.Derived))]
Sample (16)
src\OpenApi\test\Microsoft.AspNetCore.OpenApi.Tests\Shared\SharedTypes.Polymorphism.cs (16)
7
[
JsonDerivedType
(typeof(Triangle), typeDiscriminator: "triangle")]
8
[
JsonDerivedType
(typeof(Square), typeDiscriminator: "square")]
25
[
JsonDerivedType
(typeof(WeatherForecastWithCity), 0)]
26
[
JsonDerivedType
(typeof(WeatherForecastWithTimeSeries), 1)]
27
[
JsonDerivedType
(typeof(WeatherForecastWithLocalNews), 2)]
48
[
JsonDerivedType
(typeof(Student), typeDiscriminator: "student")]
49
[
JsonDerivedType
(typeof(Teacher), typeDiscriminator: "teacher")]
66
[
JsonDerivedType
(typeof(PaintColor), typeDiscriminator: "paint")]
67
[
JsonDerivedType
(typeof(FabricColor), typeDiscriminator: "fabric")]
85
[
JsonDerivedType
(typeof(Cat), typeDiscriminator: "cat")]
86
[
JsonDerivedType
(typeof(Dog), typeDiscriminator: "dog")]
87
[
JsonDerivedType
(typeof(Pet), typeDiscriminator: "pet")]
105
[
JsonDerivedType
(typeof(Animal))]
106
[
JsonDerivedType
(typeof(Plant))]
123
[
JsonDerivedType
(typeof(Manager), typeDiscriminator: "manager")]
124
[
JsonDerivedType
(typeof(Employee), typeDiscriminator: "employee")]
Shared.Tests (6)
JsonSchemaExporter\TestTypes.cs (6)
1073
[
JsonDerivedType
(typeof(DerivedPocoNoDiscriminator))]
1074
[
JsonDerivedType
(typeof(DerivedPocoStringDiscriminator), "derivedPoco")]
1075
[
JsonDerivedType
(typeof(DerivedPocoIntDiscriminator), 42)]
1076
[
JsonDerivedType
(typeof(DerivedCollection), "derivedCollection")]
1077
[
JsonDerivedType
(typeof(DerivedDictionary), "derivedDictionary")]
1116
[
JsonDerivedType
(typeof(NonAbstractClassWithSingleDerivedType.Derived))]
3 references to JsonDerivedType
System.Text.Json (3)
System\Text\Json\Serialization\Metadata\JsonPolymorphismOptions.cs (2)
115
foreach (
JsonDerivedTypeAttribute
attr in baseType.GetCustomAttributes<
JsonDerivedTypeAttribute
>(inherit: false))
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
302
/// the configuration of this setting will be mapped from any <see cref="
JsonDerivedTypeAttribute
"/> or <see cref="JsonPolymorphicAttribute"/> annotations.