9 writes to Type
Microsoft.AspNetCore.Mvc.ApiExplorer (9)
ApiResponseTypeProvider.cs (7)
112Type = type, 173Type = metadataAttribute.Type, 187apiResponseType.Type = type; 194apiResponseType.Type = errorSetByDefault ? defaultErrorType : apiResponseType.Type; 198apiResponseType.Type = defaultErrorType; 246Type = metadata.Type, 256apiResponseType.Type = type;
EndpointMetadataApiDescriptionProvider.cs (2)
361apiResponseType.Type = responseType; 454Type = responseType,
133 references to Type
ApiExplorerWebSite (1)
ApiExplorerDataFilter.cs (1)
100ResponseType = 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 (12)
ApiResponseTypeProvider.cs (6)
179if (apiResponseType.Type == typeof(void)) 194apiResponseType.Type = errorSetByDefault ? defaultErrorType : apiResponseType.Type; 214if (apiResponseType.Type != null) 250if (apiResponseType.Type == null) 271if (apiResponseType.Type != null) 299var responseType = apiResponse.Type;
EndpointMetadataApiDescriptionProvider.cs (6)
359if (apiResponseType.Type is null || (apiResponseType.Type == typeof(void) && errorSetByDefault)) 364apiResponseType.ModelMetadata = CreateModelMetadata(apiResponseType.Type); 372else if (apiResponseType.ApiResponseFormats.Count == 0 && CreateDefaultApiResponseFormat(apiResponseType.Type) is { } defaultResponseFormat) 407TypesAreCompatible(apiResponseType.Type, metadata.Type) &&
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (115)
ApiResponseTypeProviderTest.cs (43)
40Assert.Equal(typeof(BaseModel), responseType.Type); 53Assert.Equal(typeof(void), responseType.Type); 60Assert.Equal(typeof(void), responseType.Type); 105Assert.Equal(typeof(BaseModel), responseType.Type); 118Assert.Equal(typeof(ProblemDetails), responseType.Type); 131Assert.Equal(typeof(void), responseType.Type); 163Assert.Equal(typeof(BaseModel), responseType.Type); 176Assert.Equal(typeof(void), responseType.Type); 183Assert.Equal(typeof(void), responseType.Type); 220Assert.Equal(typeof(BaseModel), responseType.Type); 234Assert.Equal(typeof(void), responseType.Type); 242Assert.Equal(typeof(void), responseType.Type); 274Assert.Equal(typeof(BaseModel), responseType.Type); 313Assert.Equal(typeof(SerializableError), responseType.Type); 321Assert.Equal(typeof(BaseModel), responseType.Type); 330Assert.Equal(typeof(void), responseType.Type); 369Assert.Equal(typeof(BaseModel), responseType.Type); 378Assert.Equal(typeof(void), responseType.Type); 412Assert.Equal(typeof(BaseModel), responseType.Type); 420Assert.Equal(errorType, responseType.Type); 429Assert.Equal(errorType, responseType.Type); 463Assert.Equal(errorType, responseType.Type); 472Assert.Equal(typeof(BaseModel), responseType.Type); 506Assert.Equal(typeof(DivideByZeroException), responseType.Type); 515Assert.Equal(typeof(BaseModel), responseType.Type); 523Assert.Equal(typeof(DivideByZeroException), responseType.Type); 558Assert.Equal(typeof(BaseModel), responseType.Type); 566Assert.Equal(typeof(void), responseType.Type); 572Assert.Equal(typeof(void), responseType.Type); 604Assert.Equal(typeof(void), responseType.Type); 610Assert.Equal(typeof(InvalidCastException), responseType.Type); 619Assert.Equal(typeof(void), responseType.Type); 650Assert.Equal(typeof(ProblemDetails), responseType.Type); 658Assert.Equal(typeof(DerivedModel), responseType.Type); 667Assert.Equal(typeof(ProblemDetails), responseType.Type); 700Assert.Equal(typeof(string), responseType.Type); 730Assert.Equal(typeof(DerivedModel), responseType.Type); 756Assert.Equal(typeof(DerivedModel), responseType.Type); 788Assert.Equal(typeof(BaseModel), responseType.Type); 795Assert.Equal(typeof(ValidationProblemDetails), responseType.Type); 801Assert.Equal(typeof(ProblemDetails), responseType.Type); 807Assert.Equal(typeof(void), responseType.Type); 840Assert.Equal(typeof(MyResponse), response.Type);
DefaultApiDescriptionProviderTest.cs (30)
529Assert.Equal(typeof(Product), responseType.Type); 547Assert.Equal(typeof(Product), responseType.Type); 566Assert.Equal(typeof(Product), responseType.Type); 588Assert.Equal(typeof(Customer), responseType.Type); 606Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 622Assert.Equal(typeof(Product), responseType.Type); 638Assert.Equal(typeof(Product), responseType.Type); 735Assert.Equal(typeof(Customer), responseType.Type); 742Assert.Equal(typeof(void), responseType.Type); 749Assert.Equal(typeof(BadData), responseType.Type); 756Assert.Equal(typeof(ErrorDetails), responseType.Type); 844Assert.Equal(typeof(void), responseType.Type); 851Assert.Equal(typeof(BadData), responseType.Type); 858Assert.Equal(typeof(ErrorDetails), responseType.Type); 907Assert.Equal(typeof(Product), responseType.Type); 914Assert.Equal(typeof(void), responseType.Type); 921Assert.Equal(typeof(BadData), responseType.Type); 928Assert.Equal(typeof(ErrorDetails), responseType.Type); 977Assert.Equal(typeof(Product), responseType.Type); 984Assert.Equal(typeof(void), responseType.Type); 991Assert.Equal(typeof(BadData), responseType.Type); 998Assert.Equal(typeof(ErrorDetails), responseType.Type); 1047Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1054Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1061Assert.Equal(typeof(BadData), responseType.Type); 1068Assert.Equal(typeof(ErrorDetails), responseType.Type); 1090Assert.Equal(typeof(void), responseType.Type); 1115Assert.Equal(typeof(void), responseType.Type); 1156Assert.Equal(typeof(Order), responseTypes.Type); 1230Assert.Equal(typeof(Order), responseType.Type);
EndpointMetadataApiDescriptionProviderTest.cs (42)
139Assert.Equal(expectedType, responseType.Type); 158Assert.Equal(typeof(string), responseType.Type); 173Assert.Equal(typeof(void), responseType.Type); 197Assert.Equal(typeof(InferredJsonClass), inferredResponseType.Type); 205Assert.Equal(typeof(TimeSpan), annotatedResponseType.Type); 224Assert.Equal(typeof(InferredJsonClass), rdfInferredResponseType.Type); 233Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 242Assert.Equal(typeof(InferredJsonClass), badRequestResponseType.Type); 262Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 271Assert.Equal(typeof(void), badRequestResponseType.Type); 288Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 297Assert.Equal(typeof(void), badRequestResponseType.Type); 319Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 329Assert.Equal(typeof(void), badRequestResponseType.Type); 345Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.Type); 364Assert.Equal(typeof(GenericClass<TimeSpan>), okResponseType.Type); 383Assert.Equal(typeof(List<TimeSpan>), okResponseType.Type); // We use List as the inferred type has higher priority than those set by metadata (attributes) 402Assert.Equal(typeof(List<TimeSpan>), okResponseType.Type); // We use List as the inferred type has higher priority than those set by metadata (attributes) 431Assert.Equal(typeof(object), okResponseType.Type); 452Assert.Equal(typeof(InferredJsonClass), rdfInferredResponseType.Type); 462Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 472Assert.Equal(typeof(InferredJsonClass), badRequestResponseType.Type); 503Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 513Assert.Equal(typeof(void), badRequestResponseType.Type); 528Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 546Assert.Equal(typeof(void), responseType.Type); 561Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 582Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 591Assert.Equal(typeof(void), badRequestResponseType.Type); 616Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 625Assert.Equal(typeof(void), badRequestResponseType.Type); 640Assert.Equal(typeof(CustomIResultImplementor), okResponseType.Type); 1093Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 400, Type: { } type } && type == typeof(ProblemDetails)); 1094Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 200, Type: { } type } && type == typeof(string)); 1119Assert.Equal(typeof(InferredJsonClass), responseTypes.Type); 1173Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1179Assert.Equal(typeof(HttpValidationProblemDetails), responseType.Type); 1185Assert.Equal(typeof(ProblemDetails), responseType.Type); 1191Assert.Equal(typeof(ProblemDetails), responseType.Type); 1223Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1229Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1323Assert.Equal(typeof(InferredJsonClass), responseType.Type);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
ApiExplorerTest.cs (1)
1584Assert.Equal(typeof(Product), responseType.Type);
Microsoft.AspNetCore.OpenApi (2)
Extensions\TypeExtensions.cs (1)
44var responseType = apiResponseType.Type;
Services\OpenApiDocumentService.cs (1)
427if (apiResponseType.Type is { } responseType)