21 instantiations of ProducesErrorResponseTypeAttribute
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (8)
ApiResponseTypeProviderTest.cs (8)
339actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 391actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 434actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 485actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(InvalidTimeZoneException)); 531actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(void)); 577actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails)); 627actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails)); 657actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails));
Microsoft.AspNetCore.Mvc.Core (1)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
44var defaultErrorTypeAttribute = new ProducesErrorResponseTypeAttribute(defaultErrorType);
Microsoft.AspNetCore.Mvc.Core.Test (6)
ApplicationModels\ApiConventionApplicationModelConventionTest.cs (6)
10[assembly: ProducesErrorResponseType(typeof(InvalidEnumArgumentException))] 104controllerAttributes: new[] { new ProducesErrorResponseTypeAttribute(expected) }); 122actionAttributes: new[] { new ProducesErrorResponseTypeAttribute(expected) }, 123controllerAttributes: new[] { new ProducesErrorResponseTypeAttribute(typeof(Guid)) }); 139var action = GetActionModel(nameof(TestController.Delete), new[] { new ProducesErrorResponseTypeAttribute(expected) }); 153return new ApiConventionApplicationModelConvention(new ProducesErrorResponseTypeAttribute(errorType));
Mvc.Api.Analyzers.Test (6)
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsResponseTypeWhenDifferentFromErrorType.Input.cs (1)
3[ProducesErrorResponseType(typeof(CodeFixAddsResponseTypeWhenDifferentErrorModel))]
TestFiles\AddResponseTypeAttributeCodeFixProviderIntegrationTest\CodeFixAddsResponseTypeWhenDifferentFromErrorType.Output.cs (1)
5[ProducesErrorResponseType(typeof(CodeFixAddsResponseTypeWhenDifferentErrorModel))]
TestFiles\SymbolApiResponseMetadataProviderTest\GetErrorResponseType_ReturnsTypeDefinedAtAction.cs (2)
8[ProducesErrorResponseType(typeof(ModelStateDictionary))] 11[ProducesErrorResponseType(typeof(GetErrorResponseType_ReturnsTypeDefinedAtActionModel))]
TestFiles\SymbolApiResponseMetadataProviderTest\GetErrorResponseType_ReturnsTypeDefinedAtAssembly.cs (1)
6[assembly: ProducesErrorResponseType(typeof(Microsoft.AspNetCore.Mvc.Api.Analyzers.TestFiles.SymbolApiResponseMetadataProviderTest.GetErrorResponseType_ReturnsTypeDefinedAtAssemblyModel))]
TestFiles\SymbolApiResponseMetadataProviderTest\GetErrorResponseType_ReturnsTypeDefinedAtController.cs (1)
6[ProducesErrorResponseType(typeof(GetErrorResponseType_ReturnsTypeDefinedAtControllerModel))]
35 references to ProducesErrorResponseTypeAttribute
Microsoft.AspNetCore.Mvc.ApiExplorer (4)
ApiResponseTypeProvider.cs (2)
48if (action.Properties.TryGetValue(typeof(ProducesErrorResponseTypeAttribute), out result)) 50defaultErrorType = ((ProducesErrorResponseTypeAttribute)result!).Type;
EndpointMetadataApiDescriptionProvider.cs (2)
331var errorMetadata = endpointMetadata.GetMetadata<ProducesErrorResponseTypeAttribute>();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (8)
ApiResponseTypeProviderTest.cs (8)
339actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 391actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 434actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(errorType); 485actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(InvalidTimeZoneException)); 531actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(void)); 577actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails)); 627actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails)); 657actionDescriptor.Properties[typeof(ProducesErrorResponseTypeAttribute)] = new ProducesErrorResponseTypeAttribute(typeof(ProblemDetails));
Microsoft.AspNetCore.Mvc.Core (11)
ApplicationModels\ApiBehaviorApplicationModelProvider.cs (1)
44var defaultErrorTypeAttribute = new ProducesErrorResponseTypeAttribute(defaultErrorType);
ApplicationModels\ApiConventionApplicationModelConvention.cs (9)
14/// <item><description><see cref="ProducesErrorResponseTypeAttribute"/> that applies to the action.</description></item> 25public ApiConventionApplicationModelConvention(ProducesErrorResponseTypeAttribute defaultErrorResponseType) 31/// Gets the default <see cref="ProducesErrorResponseTypeAttribute"/> that is associated with an action 34public ProducesErrorResponseTypeAttribute DefaultErrorResponseType { get; } 78var errorTypeAttribute = 79action.Attributes.OfType<ProducesErrorResponseTypeAttribute>().FirstOrDefault() ?? 80action.Controller.Attributes.OfType<ProducesErrorResponseTypeAttribute>().FirstOrDefault() ?? 81action.Controller.ControllerType.Assembly.GetCustomAttribute<ProducesErrorResponseTypeAttribute>() ?? 84action.Properties[typeof(ProducesErrorResponseTypeAttribute)] = errorTypeAttribute;
ProducesErrorResponseTypeAttribute.cs (1)
22/// Initializes a new instance of <see cref="ProducesErrorResponseTypeAttribute"/>.
Microsoft.AspNetCore.Mvc.Core.Test (10)
ApplicationModels\ApiConventionApplicationModelConventionTest.cs (10)
77var attribute = GetProperty<ProducesErrorResponseTypeAttribute>(action); 93var attribute = GetProperty<ProducesErrorResponseTypeAttribute>(action); 111var attribute = GetProperty<ProducesErrorResponseTypeAttribute>(action); 130var attribute = GetProperty<ProducesErrorResponseTypeAttribute>(action); 146var attribute = GetProperty<ProducesErrorResponseTypeAttribute>(action);
Microsoft.AspNetCore.OpenApi (2)
Services\OpenApiGenerator.cs (2)
112var errorMetadata = metadata.GetMetadata<ProducesErrorResponseTypeAttribute>();