9 writes to Type
Microsoft.AspNetCore.Mvc.ApiExplorer (9)
ApiResponseTypeProvider.cs (7)
112
Type
= type,
173
Type
= metadataAttribute.Type,
187
apiResponseType.
Type
= type;
194
apiResponseType.
Type
= errorSetByDefault ? defaultErrorType : apiResponseType.Type;
198
apiResponseType.
Type
= defaultErrorType;
245
Type
= metadata.Type,
255
apiResponseType.
Type
= type;
EndpointMetadataApiDescriptionProvider.cs (2)
362
apiResponseType.
Type
= responseType;
406
Type
= responseType,
112 references to Type
ApiExplorerWebSite (1)
ApiExplorerDataFilter.cs (1)
100
ResponseType = response.
Type
?.FullName,
Microsoft.AspNetCore.Mvc.Abstractions (2)
ApiExplorer\ApiResponseType.cs (2)
19
/// Gets or sets <see cref="ModelBinding.ModelMetadata"/> for the <see cref="
Type
"/> or null.
22
/// Will be null if <see cref="
Type
"/> is null or void.
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
ApiResponseTypeProvider.cs (6)
179
if (apiResponseType.
Type
== typeof(void))
194
apiResponseType.Type = errorSetByDefault ? defaultErrorType : apiResponseType.
Type
;
214
if (apiResponseType.
Type
!= null)
249
if (apiResponseType.
Type
== null)
270
if (apiResponseType.
Type
!= null)
298
var responseType = apiResponse.
Type
;
EndpointMetadataApiDescriptionProvider.cs (4)
360
if (apiResponseType.
Type
is null || (apiResponseType.
Type
== typeof(void) && errorSetByDefault))
365
apiResponseType.ModelMetadata = CreateModelMetadata(apiResponseType.
Type
);
373
else if (apiResponseType.ApiResponseFormats.Count == 0 && CreateDefaultApiResponseFormat(apiResponseType.
Type
) is { } defaultResponseFormat)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (98)
ApiResponseTypeProviderTest.cs (39)
40
Assert.Equal(typeof(BaseModel), responseType.
Type
);
53
Assert.Equal(typeof(void), responseType.
Type
);
60
Assert.Equal(typeof(void), responseType.
Type
);
105
Assert.Equal(typeof(BaseModel), responseType.
Type
);
118
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
131
Assert.Equal(typeof(void), responseType.
Type
);
163
Assert.Equal(typeof(BaseModel), responseType.
Type
);
176
Assert.Equal(typeof(void), responseType.
Type
);
183
Assert.Equal(typeof(void), responseType.
Type
);
214
Assert.Equal(typeof(BaseModel), responseType.
Type
);
253
Assert.Equal(typeof(SerializableError), responseType.
Type
);
261
Assert.Equal(typeof(BaseModel), responseType.
Type
);
270
Assert.Equal(typeof(void), responseType.
Type
);
309
Assert.Equal(typeof(BaseModel), responseType.
Type
);
318
Assert.Equal(typeof(void), responseType.
Type
);
352
Assert.Equal(typeof(BaseModel), responseType.
Type
);
360
Assert.Equal(errorType, responseType.
Type
);
369
Assert.Equal(errorType, responseType.
Type
);
403
Assert.Equal(errorType, responseType.
Type
);
412
Assert.Equal(typeof(BaseModel), responseType.
Type
);
446
Assert.Equal(typeof(DivideByZeroException), responseType.
Type
);
455
Assert.Equal(typeof(BaseModel), responseType.
Type
);
463
Assert.Equal(typeof(DivideByZeroException), responseType.
Type
);
498
Assert.Equal(typeof(BaseModel), responseType.
Type
);
506
Assert.Equal(typeof(void), responseType.
Type
);
512
Assert.Equal(typeof(void), responseType.
Type
);
544
Assert.Equal(typeof(void), responseType.
Type
);
550
Assert.Equal(typeof(InvalidCastException), responseType.
Type
);
559
Assert.Equal(typeof(void), responseType.
Type
);
590
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
598
Assert.Equal(typeof(DerivedModel), responseType.
Type
);
607
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
640
Assert.Equal(typeof(string), responseType.
Type
);
670
Assert.Equal(typeof(DerivedModel), responseType.
Type
);
696
Assert.Equal(typeof(DerivedModel), responseType.
Type
);
728
Assert.Equal(typeof(BaseModel), responseType.
Type
);
735
Assert.Equal(typeof(ValidationProblemDetails), responseType.
Type
);
741
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
747
Assert.Equal(typeof(void), responseType.
Type
);
DefaultApiDescriptionProviderTest.cs (30)
500
Assert.Equal(typeof(Product), responseType.
Type
);
518
Assert.Equal(typeof(Product), responseType.
Type
);
537
Assert.Equal(typeof(Product), responseType.
Type
);
559
Assert.Equal(typeof(Customer), responseType.
Type
);
577
Assert.Equal(typeof(IEnumerable<Product>), responseType.
Type
);
593
Assert.Equal(typeof(Product), responseType.
Type
);
609
Assert.Equal(typeof(Product), responseType.
Type
);
706
Assert.Equal(typeof(Customer), responseType.
Type
);
713
Assert.Equal(typeof(void), responseType.
Type
);
720
Assert.Equal(typeof(BadData), responseType.
Type
);
727
Assert.Equal(typeof(ErrorDetails), responseType.
Type
);
815
Assert.Equal(typeof(void), responseType.
Type
);
822
Assert.Equal(typeof(BadData), responseType.
Type
);
829
Assert.Equal(typeof(ErrorDetails), responseType.
Type
);
878
Assert.Equal(typeof(Product), responseType.
Type
);
885
Assert.Equal(typeof(void), responseType.
Type
);
892
Assert.Equal(typeof(BadData), responseType.
Type
);
899
Assert.Equal(typeof(ErrorDetails), responseType.
Type
);
948
Assert.Equal(typeof(Product), responseType.
Type
);
955
Assert.Equal(typeof(void), responseType.
Type
);
962
Assert.Equal(typeof(BadData), responseType.
Type
);
969
Assert.Equal(typeof(ErrorDetails), responseType.
Type
);
1018
Assert.Equal(typeof(IEnumerable<Product>), responseType.
Type
);
1025
Assert.Equal(typeof(IEnumerable<Product>), responseType.
Type
);
1032
Assert.Equal(typeof(BadData), responseType.
Type
);
1039
Assert.Equal(typeof(ErrorDetails), responseType.
Type
);
1061
Assert.Equal(typeof(void), responseType.
Type
);
1086
Assert.Equal(typeof(void), responseType.
Type
);
1127
Assert.Equal(typeof(Order), responseTypes.
Type
);
1201
Assert.Equal(typeof(Order), responseType.
Type
);
EndpointMetadataApiDescriptionProviderTest.cs (29)
139
Assert.Equal(expectedType, responseType.
Type
);
158
Assert.Equal(typeof(string), responseType.
Type
);
173
Assert.Equal(typeof(void), responseType.
Type
);
197
Assert.Equal(typeof(InferredJsonClass), inferredResponseType.
Type
);
205
Assert.Equal(typeof(TimeSpan), annotatedResponseType.
Type
);
224
Assert.Equal(typeof(InferredJsonClass), rdfInferredResponseType.
Type
);
233
Assert.Equal(typeof(TimeSpan), createdResponseType.
Type
);
242
Assert.Equal(typeof(InferredJsonClass), badRequestResponseType.
Type
);
262
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
271
Assert.Equal(typeof(void), badRequestResponseType.
Type
);
288
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
297
Assert.Equal(typeof(void), badRequestResponseType.
Type
);
313
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
331
Assert.Equal(typeof(void), responseType.
Type
);
346
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
367
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
376
Assert.Equal(typeof(void), badRequestResponseType.
Type
);
401
Assert.Equal(typeof(InferredJsonClass), createdResponseType.
Type
);
410
Assert.Equal(typeof(void), badRequestResponseType.
Type
);
850
Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 400,
Type
: { } type } && type == typeof(ProblemDetails));
851
Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 200,
Type
: { } type } && type == typeof(string));
876
Assert.Equal(typeof(InferredJsonClass), responseTypes.
Type
);
930
Assert.Equal(typeof(InferredJsonClass), responseType.
Type
);
936
Assert.Equal(typeof(HttpValidationProblemDetails), responseType.
Type
);
942
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
948
Assert.Equal(typeof(ProblemDetails), responseType.
Type
);
980
Assert.Equal(typeof(InferredJsonClass), responseType.
Type
);
986
Assert.Equal(typeof(InferredJsonClass), responseType.
Type
);
1080
Assert.Equal(typeof(InferredJsonClass), responseType.
Type
);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
373
var schema = apiResponseType.
Type
is { } type ? await _componentService.GetOrCreateSchemaAsync(type, scopedServiceProvider, schemaTransformers, null, captureSchemaByRef: true, cancellationToken) : new OpenApiSchema();