1 type derived from ProducesAttribute
Microsoft.AspNetCore.Mvc.Core (1)
ProducesOfTAttribute.cs (1)
12public class ProducesAttribute<T> : ProducesAttribute
68 instantiations of ProducesAttribute
ApiExplorerWebSite (16)
Controllers\ApiExplorerApiController.cs (1)
32[Produces("application/pdf", Type = typeof(Stream))]
Controllers\ApiExplorerResponseContentTypeController.cs (3)
18[Produces("application/json", "text/json")] 25[Produces("application/hal+custom", "application/hal+json")] 32[Produces("application/custom", "text/hal+bson")]
Controllers\ApiExplorerResponseContentTypeOverrideOnActionController.cs (2)
8[Produces("text/xml")] 19[Produces("application/json")]
Controllers\ApiExplorerResponseTypeOverrideOnActionController.cs (1)
8[Produces("application/json", Type = typeof(Product))]
Controllers\ApiExplorerResponseTypeWithApiConventionController.cs (2)
23[Produces("application/json")] 29[Produces("application/json", "text/json")]
Controllers\ApiExplorerResponseTypeWithAttributeController.cs (7)
18[Produces(typeof(Customer))] 24[Produces("application/json", Type = typeof(Product))] 31[Produces("application/json", Type = typeof(string))] 45[Produces("application/json", Type = typeof(int))] 52[Produces(typeof(Customer))] // It's possible to lie about what type you return 65[Produces("text/xml")] // Has status code as 200 but is not applied as it does not set 'Type' 80[Produces("text/xml", Type = typeof(Product))] // Has status code as 200
BasicWebSite (14)
Controllers\ContentNegotiation\FormatFilterController.cs (1)
12[Produces("application/FormatFilterController")]
Controllers\ContentNegotiation\NoProducesContentOnClassController.cs (1)
23[Produces("application/custom_NoProducesContentOnClassController_Action")]
Controllers\ContentNegotiation\NormalController.cs (3)
54[Produces("application/NoFormatter")] 60[Produces("application/custom", "application/json", "text/json")] 66[Produces("application/custom")]
Controllers\ContentNegotiation\ProducesContentBaseController.cs (2)
10[Produces("application/custom_ProducesContentBaseController")] 26[Produces("application/custom_ProducesContentBaseController_Action")]
Controllers\ContentNegotiation\ProducesContentOnClassController.cs (2)
10[Produces("application/custom_ProducesContentOnClassController")] 39[Produces("application/custom_ProducesContentOnClassController_Action")]
Controllers\ContentNegotiation\ProducesJsonController.cs (1)
10[Produces("application/xml")]
Controllers\ContentNegotiation\ProducesWithMediaTypeParametersController.cs (2)
24[Produces("text/vcard;VERSION=V3.0")] 34[Produces("text/vcard;VERSION=V4.0")]
Controllers\ContentNegotiation\ProducesWithMediaTypeSuffixesController.cs (1)
12[Produces("application/vnd.example.contact+json; v=2", "application/vnd.example.contact+xml; v=2")]
Controllers\RazorComponentsController.cs (1)
62[Produces("application/json")]
FormatterWebSite (6)
Controllers\DoNotRespectBrowserAcceptHeaderController.cs (1)
21[Produces("application/xml")]
Controllers\JsonOutputFormatterController.cs (1)
10[Produces("application/json")]
Controllers\StreamController.cs (3)
24[Produces("text/plain")] 31[Produces("text/html", "text/plain")] 38[Produces("text/plain")]
Controllers\SystemTextJsonOutputFormatterController.cs (1)
11[Produces("application/json")]
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (11)
ApiResponseTypeProviderTest.cs (5)
69[Produces(typeof(BaseModel))] 570actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new ProducesAttribute("application/json"), FilterScope.Controller)); 620actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new ProducesAttribute("application/json") { Type = typeof(string) }, FilterScope.Controller)); 683actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new ProducesAttribute("application/pdf"), FilterScope.Action)); 713actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new ProducesAttribute("text/xml") { Type = typeof(BaseModel) }, FilterScope.Action));
DefaultApiDescriptionProviderTest.cs (5)
643new ProducesAttribute("text/json", "application/json") { Type = typeof(Customer) }, 743new ProducesAttribute("text/json", "application/json"), 850new ProducesAttribute("text/json", "application/json"), 920new ProducesAttribute("text/json", "application/json"), 990new ProducesAttribute("text/json", "application/json"),
EndpointMetadataApiDescriptionProviderTest.cs (1)
189[Produces("application/custom")]
Microsoft.AspNetCore.Mvc.Core.Test (18)
ApiConventionMethodAttributeTest.cs (1)
29[Produces(typeof(void))]
ApiConventionTypeAttributeTest.cs (4)
17var attribute = new ProducesAttribute(typeof(object)); 30[Produces(typeof(void))] 60var attributes = new Attribute[] { new ProducesAttribute(typeof(object)), new ServiceFilterAttribute(typeof(object)), new AuthorizeAttribute() }; 73[Produces(typeof(void))]
Formatters\FormatFilterTest.cs (4)
179var produces = new ProducesAttribute(contentType, new string[] { "application/foo", "text/bar" }); 196var produces = new ProducesAttribute("application/xml;version=1", new string[] { }); 217var produces = new ProducesAttribute("application/xml", new string[] { }); 243var produces = new ProducesAttribute("application/xml", new string[] { "application/foo", "text/bar" });
ProducesAttributeTests.cs (9)
22var producesContentAttribute = new ProducesAttribute("application/json", "text/json;charset=utf-8"); 41var producesContentAttribute = new ProducesAttribute("application/xml"); 66var producesContentAttribute = new ProducesAttribute("application/xml"); 101() => new ProducesAttribute(contentTypes[0], contentTypes.Skip(1).ToArray())); 123() => new ProducesAttribute(contentTypes[0], contentTypes.Skip(1).ToArray())); 136var producesAttribute = new ProducesAttribute(personType); 147var producesAttribute = new ProducesAttribute(typeof(Person)); 158var producesAttribute = new ProducesAttribute(typeof(Person)) 171var producesAttribute = new ProducesAttribute(typeof(Person));
Microsoft.AspNetCore.OpenApi.Tests (2)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (1)
195builder.MapGet("/api/todos", [Produces("application/json", "application/xml")] () => new Todo(1, "Test todo", false, DateTime.Now));
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (1)
702[Produces("application/json")]
Mvc.Api.Analyzers.Test (1)
TestFiles\SymbolApiResponseMetadataProviderTest\GetResponseMetadataTests.cs (1)
20[Produces(typeof(Person))]
24 references to ProducesAttribute
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
ApiResponseTypeProvider.cs (1)
406if (provider is ProducesAttribute producesAttribute && producesAttribute.Type is null)
Microsoft.AspNetCore.Mvc.Core (4)
ProducesAttribute.cs (2)
22/// Initializes an instance of <see cref="ProducesAttribute"/>. 32/// Initializes an instance of <see cref="ProducesAttribute"/> with allowed content types.
ProducesOfTAttribute.cs (2)
9/// This is a derived generic variant of the <see cref="ProducesAttribute"/>. 15/// Initializes an instance of <see cref="ProducesAttribute"/>.
Microsoft.AspNetCore.Mvc.Core.Test (18)
ApiConventionMethodAttributeTest.cs (6)
16var attribute = typeof(ProducesAttribute); 38var attribute = typeof(ProducesAttribute); 79var attribute = typeof(ProducesAttribute); 89var attribute = typeof(ProducesAttribute); 106var attribute = typeof(ProducesAttribute); 123var attribute = typeof(ProducesAttribute);
ApiConventionTypeAttributeTest.cs (1)
17var attribute = new ProducesAttribute(typeof(object));
Formatters\FormatFilterTest.cs (4)
179var produces = new ProducesAttribute(contentType, new string[] { "application/foo", "text/bar" }); 196var produces = new ProducesAttribute("application/xml;version=1", new string[] { }); 217var produces = new ProducesAttribute("application/xml", new string[] { }); 243var produces = new ProducesAttribute("application/xml", new string[] { "application/foo", "text/bar" });
ProducesAttributeTests.cs (7)
22var producesContentAttribute = new ProducesAttribute("application/json", "text/json;charset=utf-8"); 41var producesContentAttribute = new ProducesAttribute("application/xml"); 66var producesContentAttribute = new ProducesAttribute("application/xml"); 136var producesAttribute = new ProducesAttribute(personType); 147var producesAttribute = new ProducesAttribute(typeof(Person)); 158var producesAttribute = new ProducesAttribute(typeof(Person)) 171var producesAttribute = new ProducesAttribute(typeof(Person));
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
381.OfType<ProducesAttribute>()