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; 406Type = responseType,
112 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 (10)
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 (4)
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)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (98)
ApiResponseTypeProviderTest.cs (39)
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); 214Assert.Equal(typeof(BaseModel), responseType.Type); 253Assert.Equal(typeof(SerializableError), responseType.Type); 261Assert.Equal(typeof(BaseModel), responseType.Type); 270Assert.Equal(typeof(void), responseType.Type); 309Assert.Equal(typeof(BaseModel), responseType.Type); 318Assert.Equal(typeof(void), responseType.Type); 352Assert.Equal(typeof(BaseModel), responseType.Type); 360Assert.Equal(errorType, responseType.Type); 369Assert.Equal(errorType, responseType.Type); 403Assert.Equal(errorType, responseType.Type); 412Assert.Equal(typeof(BaseModel), responseType.Type); 446Assert.Equal(typeof(DivideByZeroException), responseType.Type); 455Assert.Equal(typeof(BaseModel), responseType.Type); 463Assert.Equal(typeof(DivideByZeroException), responseType.Type); 498Assert.Equal(typeof(BaseModel), responseType.Type); 506Assert.Equal(typeof(void), responseType.Type); 512Assert.Equal(typeof(void), responseType.Type); 544Assert.Equal(typeof(void), responseType.Type); 550Assert.Equal(typeof(InvalidCastException), responseType.Type); 559Assert.Equal(typeof(void), responseType.Type); 590Assert.Equal(typeof(ProblemDetails), responseType.Type); 598Assert.Equal(typeof(DerivedModel), responseType.Type); 607Assert.Equal(typeof(ProblemDetails), responseType.Type); 640Assert.Equal(typeof(string), responseType.Type); 670Assert.Equal(typeof(DerivedModel), responseType.Type); 696Assert.Equal(typeof(DerivedModel), responseType.Type); 728Assert.Equal(typeof(BaseModel), responseType.Type); 735Assert.Equal(typeof(ValidationProblemDetails), responseType.Type); 741Assert.Equal(typeof(ProblemDetails), responseType.Type); 747Assert.Equal(typeof(void), responseType.Type);
DefaultApiDescriptionProviderTest.cs (30)
500Assert.Equal(typeof(Product), responseType.Type); 518Assert.Equal(typeof(Product), responseType.Type); 537Assert.Equal(typeof(Product), responseType.Type); 559Assert.Equal(typeof(Customer), responseType.Type); 577Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 593Assert.Equal(typeof(Product), responseType.Type); 609Assert.Equal(typeof(Product), responseType.Type); 706Assert.Equal(typeof(Customer), responseType.Type); 713Assert.Equal(typeof(void), responseType.Type); 720Assert.Equal(typeof(BadData), responseType.Type); 727Assert.Equal(typeof(ErrorDetails), responseType.Type); 815Assert.Equal(typeof(void), responseType.Type); 822Assert.Equal(typeof(BadData), responseType.Type); 829Assert.Equal(typeof(ErrorDetails), responseType.Type); 878Assert.Equal(typeof(Product), responseType.Type); 885Assert.Equal(typeof(void), responseType.Type); 892Assert.Equal(typeof(BadData), responseType.Type); 899Assert.Equal(typeof(ErrorDetails), responseType.Type); 948Assert.Equal(typeof(Product), responseType.Type); 955Assert.Equal(typeof(void), responseType.Type); 962Assert.Equal(typeof(BadData), responseType.Type); 969Assert.Equal(typeof(ErrorDetails), responseType.Type); 1018Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1025Assert.Equal(typeof(IEnumerable<Product>), responseType.Type); 1032Assert.Equal(typeof(BadData), responseType.Type); 1039Assert.Equal(typeof(ErrorDetails), responseType.Type); 1061Assert.Equal(typeof(void), responseType.Type); 1086Assert.Equal(typeof(void), responseType.Type); 1127Assert.Equal(typeof(Order), responseTypes.Type); 1201Assert.Equal(typeof(Order), responseType.Type);
EndpointMetadataApiDescriptionProviderTest.cs (29)
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); 313Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 331Assert.Equal(typeof(void), responseType.Type); 346Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 367Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 376Assert.Equal(typeof(void), badRequestResponseType.Type); 401Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 410Assert.Equal(typeof(void), badRequestResponseType.Type); 850Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 400, Type: { } type } && type == typeof(ProblemDetails)); 851Assert.Contains(apiDescription.SupportedResponseTypes, m => m is { StatusCode: 200, Type: { } type } && type == typeof(string)); 876Assert.Equal(typeof(InferredJsonClass), responseTypes.Type); 930Assert.Equal(typeof(InferredJsonClass), responseType.Type); 936Assert.Equal(typeof(HttpValidationProblemDetails), responseType.Type); 942Assert.Equal(typeof(ProblemDetails), responseType.Type); 948Assert.Equal(typeof(ProblemDetails), responseType.Type); 980Assert.Equal(typeof(InferredJsonClass), responseType.Type); 986Assert.Equal(typeof(InferredJsonClass), responseType.Type); 1080Assert.Equal(typeof(InferredJsonClass), responseType.Type);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
373var schema = apiResponseType.Type is { } type ? await _componentService.GetOrCreateSchemaAsync(type, scopedServiceProvider, schemaTransformers, null, captureSchemaByRef: true, cancellationToken) : new OpenApiSchema();