9 writes to Type
Microsoft.AspNetCore.Mvc.ApiExplorer (9)
ApiResponseTypeProvider.cs (7)
111Type = type, 168Type = metadataAttribute.Type, 181apiResponseType.Type = type; 188apiResponseType.Type = setByDefault ? defaultErrorType : apiResponseType.Type; 192apiResponseType.Type = defaultErrorType; 232Type = metadata.Type, 242apiResponseType.Type = type;
EndpointMetadataApiDescriptionProvider.cs (2)
364apiResponseType.Type = responseType; 408Type = responseType,
100 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)
173if (apiResponseType.Type == typeof(void)) 188apiResponseType.Type = setByDefault ? defaultErrorType : apiResponseType.Type; 208if (apiResponseType.Type != null) 236if (apiResponseType.Type == typeof(void)) 257if (apiResponseType.Type != null) 285var responseType = apiResponse.Type;
EndpointMetadataApiDescriptionProvider.cs (4)
362if (apiResponseType.Type is null || apiResponseType.Type == typeof(void)) 367apiResponseType.ModelMetadata = CreateModelMetadata(apiResponseType.Type); 375else if (apiResponseType.ApiResponseFormats.Count == 0 && CreateDefaultApiResponseFormat(apiResponseType.Type) is { } defaultResponseFormat)
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (86)
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); 1126Assert.Equal(typeof(Order), responseTypes.Type); 1199Assert.Equal(typeof(Order), responseType.Type);
EndpointMetadataApiDescriptionProviderTest.cs (17)
138Assert.Equal(expectedType, responseType.Type); 157Assert.Equal(typeof(string), responseType.Type); 172Assert.Equal(typeof(void), responseType.Type); 194Assert.Equal(typeof(TimeSpan), responseType.Type); 214Assert.Equal(typeof(TimeSpan), createdResponseType.Type); 223Assert.Equal(typeof(InferredJsonClass), badRequestResponseType.Type); 243Assert.Equal(typeof(InferredJsonClass), createdResponseType.Type); 252Assert.Equal(typeof(void), badRequestResponseType.Type); 683Assert.Equal(typeof(ProblemDetails), responseTypes.Type); 708Assert.Equal(typeof(InferredJsonClass), responseTypes.Type); 762Assert.Equal(typeof(InferredJsonClass), responseType.Type); 768Assert.Equal(typeof(HttpValidationProblemDetails), responseType.Type); 774Assert.Equal(typeof(ProblemDetails), responseType.Type); 780Assert.Equal(typeof(ProblemDetails), responseType.Type); 812Assert.Equal(typeof(InferredJsonClass), responseType.Type); 818Assert.Equal(typeof(InferredJsonClass), responseType.Type); 912Assert.Equal(typeof(InferredJsonClass), responseType.Type);
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
225var schema = apiResponseType.Type is { } type ? await _componentService.GetOrCreateSchemaAsync(type, null, cancellationToken) : new OpenApiSchema();