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