36 references to AcceptsMetadata
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
MetadataTests.cs (4)
25
Assert.Equal("Accepts ContentTypes: application/json, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json" }).ToString());
26
Assert.Equal("Accepts ContentTypes: application/json,text/plain, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json", "text/plain" }).ToString());
27
Assert.Equal("Accepts ContentTypes: application/json, RequestType: System.Version, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json" }, type: typeof(Version)).ToString());
28
Assert.Equal("Accepts ContentTypes: application/json, IsOptional: True", new
AcceptsMetadata
(new[] { "application/json" }, isOptional: true).ToString());
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
426
builder.Metadata.Add(new
AcceptsMetadata
(consumesAttribute.ContentTypes.ToArray()));
Microsoft.AspNetCore.OpenApi.Tests (2)
Services\OpenApiGeneratorTests.cs (2)
660
new
AcceptsMetadata
(new string[] { "application/json", "application/xml"}, typeof(string), true)
686
new
AcceptsMetadata
(new string[] { "application/json" }, typeof(InferredJsonClass), true)
Microsoft.AspNetCore.Routing (1)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (1)
280
return builder.WithMetadata(new
AcceptsMetadata
(contentTypes, requestType, isOptional));
Microsoft.AspNetCore.Routing.Tests (28)
Matching\AcceptsMatcherPolicyTest.cs (28)
35
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
53
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
54
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
72
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
73
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
106
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
124
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
125
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
143
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
144
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
164
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", "application/*+json", })),
165
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
166
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/xml", "application/*+xml", })),
167
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/*", })),
168
CreateEndpoint("/", new
AcceptsMetadata
(new[]{ "*/*", })),
224
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", "application/*+json", })),
225
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/xml", "application/*+xml", })),
226
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/*", })),
340
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
361
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*" })),
409
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
436
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*" })),
463
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "application/*+json", })),
490
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
517
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
545
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
574
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
575
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*", }))