33 instantiations of ProducesResponseTypeMetadata
Microsoft.AspNetCore.Http.Abstractions (1)
Metadata\ProducesResponseTypeMetadata.cs (1)
87internal static ProducesResponseTypeMetadata CreateUnvalidated(Type? type, int statusCode, IEnumerable<string> contentTypes) => new(statusCode, type, contentTypes);
Microsoft.AspNetCore.Http.Abstractions.Tests (5)
MetadataTests.cs (5)
14Assert.Equal("Produces StatusCode: 100", new ProducesResponseTypeMetadata(100).ToString()); 15Assert.Equal("Produces StatusCode: 200, ContentTypes: application/json", new ProducesResponseTypeMetadata(200, contentTypes: new[] { "application/json" }).ToString()); 16Assert.Equal("Produces StatusCode: 300, ContentTypes: application/json,text/plain", new ProducesResponseTypeMetadata(300, contentTypes: new[] { "application/json", "text/plain" }).ToString()); 17Assert.Equal("Produces StatusCode: 400, Type: System.Version", new ProducesResponseTypeMetadata(400, type: typeof(Version)).ToString()); 18Assert.Equal("Produces StatusCode: 500, Type: System.Void", new ProducesResponseTypeMetadata(500, type: typeof(void)).ToString());
Microsoft.AspNetCore.Http.Results (11)
Accepted.cs (1)
84builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status202Accepted, typeof(void)));
AcceptedAtRoute.cs (1)
111builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status202Accepted, typeof(void)));
BadRequest.cs (1)
54builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status400BadRequest, typeof(void)));
Conflict.cs (1)
54builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status409Conflict, typeof(void)));
Created.cs (1)
84builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status201Created, typeof(void)));
CreatedAtRoute.cs (1)
111builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status201Created, typeof(void)));
InternalServerError.cs (1)
54builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status500InternalServerError, typeof(void)));
NoContent.cs (1)
54builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status204NoContent, typeof(void)));
NotFound.cs (1)
53builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status404NotFound, typeof(void)));
Ok.cs (1)
53builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(void)));
UnprocessableEntity.cs (1)
54builder.Metadata.Add(new ProducesResponseTypeMetadata(StatusCodes.Status422UnprocessableEntity, typeof(void)));
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (2)
DefaultApiDescriptionProviderTest.cs (2)
529action.EndpointMetadata = new List<object>() { new ProducesResponseTypeMetadata(200, typeof(Product)) }; 548action.EndpointMetadata = new List<object>() { new ProducesResponseTypeMetadata(200, typeof(Product)) };
Microsoft.AspNetCore.OpenApi.Tests (12)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (1)
72.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK))
Services\OpenApiGeneratorTests.cs (11)
540new ProducesResponseTypeMetadata(StatusCodes.Status400BadRequest, typeof(ProblemDetails), new [] { "application/json+problem" }) 557new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(InferredJsonClass), new[] { "application/json" }), 573new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(InferredJsonClass), new[] { "application/json" }), 587new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(InferredJsonClass), new[] { "application/json" }), 588new ProducesResponseTypeMetadata(StatusCodes.Status400BadRequest, typeof(HttpValidationProblemDetails), new[] { "application/problem+json" }), 589new ProducesResponseTypeMetadata(StatusCodes.Status404NotFound, typeof(ProblemDetails), new[] { "application/problem+json" }), 590new ProducesResponseTypeMetadata(StatusCodes.Status409Conflict, typeof(ProblemDetails), new[] { "application/problem+json" }) 630new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(InferredJsonClass), new[] { "application/json" }), 631new ProducesResponseTypeMetadata(StatusCodes.Status201Created, typeof(InferredJsonClass), new[] { "application/json" }) 877new ProducesResponseTypeMetadata(StatusCodes.Status200OK), 879new ProducesResponseTypeMetadata(StatusCodes.Status200OK, typeof(InferredJsonClass), new[] { "application/json" }),
Microsoft.AspNetCore.Routing (2)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (2)
84return builder.WithMetadata(new ProducesResponseTypeMetadata(statusCode, responseType ?? typeof(void))); 91return builder.WithMetadata(new ProducesResponseTypeMetadata(statusCode, responseType ?? typeof(void), contentTypes));
70 references to ProducesResponseTypeMetadata
Microsoft.AspNetCore.Http.Abstractions (2)
Metadata\ProducesResponseTypeMetadata.cs (2)
19/// Initializes an instance of <see cref="ProducesResponseTypeMetadata"/>. 87internal static ProducesResponseTypeMetadata CreateUnvalidated(Type? type, int statusCode, IEnumerable<string> contentTypes) => new(statusCode, type, contentTypes);
Microsoft.AspNetCore.Http.Extensions (3)
RequestDelegateFactory.cs (3)
1047builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(type: typeof(string), statusCode: 200, PlaintextContentType)); 1051builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(returnType, statusCode: 200, PlaintextContentType)); 1055builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(returnType, statusCode: 200, DefaultAcceptsAndProducesContentType));
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (2)
2708Assert.Contains(result.EndpointMetadata, m => m is ProducesResponseTypeMetadata { Type: { } type } && type == typeof(CountsDefaultEndpointMetadataResult)); 2731Assert.Contains(result.EndpointMetadata, m => m is ProducesResponseTypeMetadata { Type: { } type } && type == typeof(CountsDefaultEndpointMetadataResult));
Microsoft.AspNetCore.Http.Results (11)
AcceptedAtRouteOfT.cs (1)
125builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status202Accepted, ContentTypeConstants.ApplicationJsonContentTypes));
AcceptedOfT.cs (1)
103builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status202Accepted, ContentTypeConstants.ApplicationJsonContentTypes));
BadRequestOfT.cs (1)
68builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status400BadRequest, ContentTypeConstants.ApplicationJsonContentTypes));
ConflictOfT.cs (1)
68builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status409Conflict, ContentTypeConstants.ApplicationJsonContentTypes));
CreatedAtRouteOfT.cs (1)
128builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status201Created, ContentTypeConstants.ApplicationJsonContentTypes));
CreatedOfT.cs (1)
102builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status201Created, ContentTypeConstants.ApplicationJsonContentTypes));
InternalServerErrorOfT.cs (1)
68builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status500InternalServerError, ContentTypeConstants.ApplicationJsonContentTypes));
NotFoundOfT.cs (1)
67builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status404NotFound, ContentTypeConstants.ApplicationJsonContentTypes));
OkOfT.cs (1)
67builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status200OK, ContentTypeConstants.ApplicationJsonContentTypes));
UnprocessableEntityOfT.cs (1)
68builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(TValue), StatusCodes.Status422UnprocessableEntity, ContentTypeConstants.ApplicationJsonContentTypes));
ValidationProblem.cs (1)
79builder.Metadata.Add(ProducesResponseTypeMetadata.CreateUnvalidated(typeof(HttpValidationProblemDetails), StatusCodes.Status400BadRequest, ContentTypeConstants.ProblemDetailsContentTypes));
Microsoft.AspNetCore.Http.Results.Tests (44)
AcceptedAtRouteOfTResultTests.cs (2)
133var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
AcceptedAtRouteResultTests.cs (2)
87var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
AcceptedOfTResultTests.cs (2)
74var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
AcceptedResultTests.cs (2)
44var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
BadRequestOfTResultTests.cs (2)
117var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
BadRequestResultTests.cs (2)
57var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
ConflictOfTResultTests.cs (2)
95var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
ConflictResultTests.cs (2)
58var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
CreatedAtRouteOfTResultTests.cs (2)
103var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
CreatedAtRouteResultTests.cs (2)
85var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
CreatedOfTResultTests.cs (2)
109var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
CreatedResultTests.cs (2)
75var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
InternalServerErrorOfTResultTests.cs (2)
117var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
InternalServerErrorResultTests.cs (2)
57var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
NoContentResultTests.cs (2)
54var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
NotFoundOfTResultTests.cs (2)
77var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
NotFoundResultTests.cs (2)
53var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
OkOfTResultTests.cs (2)
94var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
OkResultTests.cs (2)
56var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
UnprocessableEntityOfTResultTests.cs (2)
94var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
UnprocessableEntityResultTests.cs (2)
57var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
ValidationProblemResultTests.cs (2)
105var producesResponseTypeMetadata = builder.Metadata.OfType<ProducesResponseTypeMetadata>().Last();
Microsoft.AspNetCore.Routing.Tests (8)
Builder\OpenApiRouteHandlerBuilderExtensionsTest.cs (8)
51var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata)); 65var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(testBuilder.Metadata)); 79var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(builder.Metadata)); 97var metadata = Assert.IsType<ProducesResponseTypeMetadata>(Assert.Single(builder.Metadata));