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; 245Type = metadata.Type, 255apiResponseType.Type = type;
EndpointMetadataApiDescriptionProvider.cs (2)
362apiResponseType.Type = responseType; 424Type = responseType,
125 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) 249if (apiResponseType.Type == null) 270if (apiResponseType.Type != null) 298var responseType = apiResponse.Type;
EndpointMetadataApiDescriptionProvider.cs (6)
360if (apiResponseType.Type is null || (apiResponseType.Type == typeof(void) && errorSetByDefault)) 365apiResponseType.ModelMetadata = CreateModelMetadata(apiResponseType.Type); 373else if (apiResponseType.ApiResponseFormats.Count == 0 && CreateDefaultApiResponseFormat(apiResponseType.Type) is { } defaultResponseFormat) 408metadata.Type == apiResponseType.Type &&
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (108)
ApiResponseTypeProviderTest.cs (42)
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);
DefaultApiDescriptionProviderTest.cs (30)
530Assert.Equal(typeof(Product), responseType.Type); 548Assert.Equal(typeof(Product), responseType.Type); 567Assert.Equal(typeof(Product), responseType.Type); 589Assert.Equal(typeof(Customer), responseType.Type); 607Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 623Assert.Equal(typeof(Product), responseType.Type); 639Assert.Equal(typeof(Product), responseType.Type); 736Assert.Equal(typeof(Customer), responseType.Type); 743Assert.Equal(typeof(void), responseType.Type); 750Assert.Equal(typeof(BadData), responseType.Type); 757Assert.Equal(typeof(ErrorDetails), responseType.Type); 845Assert.Equal(typeof(void), responseType.Type); 852Assert.Equal(typeof(BadData), responseType.Type); 859Assert.Equal(typeof(ErrorDetails), responseType.Type); 908Assert.Equal(typeof(Product), responseType.Type); 915Assert.Equal(typeof(void), responseType.Type); 922Assert.Equal(typeof(BadData), responseType.Type); 929Assert.Equal(typeof(ErrorDetails), responseType.Type); 978Assert.Equal(typeof(Product), responseType.Type); 985Assert.Equal(typeof(void), responseType.Type); 992Assert.Equal(typeof(BadData), responseType.Type); 999Assert.Equal(typeof(ErrorDetails), responseType.Type); 1048Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1055Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1062Assert.Equal(typeof(BadData), responseType.Type); 1069Assert.Equal(typeof(ErrorDetails), responseType.Type); 1091Assert.Equal(typeof(void), responseType.Type); 1116Assert.Equal(typeof(void), responseType.Type); 1157Assert.Equal(typeof(Order), responseTypes.Type); 1231Assert.Equal(typeof(Order), responseType.Type);
EndpointMetadataApiDescriptionProviderTest.cs (36)
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); 350Assert.Equal(typeof(InferredJsonClass), rdfInferredResponseType.Type); 360Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 370Assert.Equal(typeof(InferredJsonClass), badRequestResponseType.Type); 401Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 411Assert.Equal(typeof(void), badRequestResponseType.Type); 426Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 444Assert.Equal(typeof(void), responseType.Type); 459Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 480Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 489Assert.Equal(typeof(void), badRequestResponseType.Type); 514Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 523Assert.Equal(typeof(void), badRequestResponseType.Type); 963Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 400, Type: { } type } && type == typeof(ProblemDetails)); 964Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 200, Type: { } type } && type == typeof(string)); 989Assert.Equal(typeof(InferredJsonClass), responseTypes.Type); 1043Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1049Assert.Equal(typeof(HttpValidationProblemDetails), responseType.Type); 1055Assert.Equal(typeof(ProblemDetails), responseType.Type); 1061Assert.Equal(typeof(ProblemDetails), responseType.Type); 1093Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1099Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1193Assert.Equal(typeof(InferredJsonClass), responseType.Type);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
ApiExplorerTest.cs (1)
1584Assert.Equal(typeof(Product), responseType.Type);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
412var schema = apiResponseType.Type is { } type ? await _componentService.GetOrCreateSchemaAsync(document, type, scopedServiceProvider, schemaTransformers, null, cancellationToken) : new OpenApiSchema();