Skip to content

Commit b45a0e4

Browse files
Incorrect nullability on IApiRequestFormatMetadataProvider.GetSupport… dotnet#62935
1 parent 9c26f24 commit b45a0e4

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/Http/Routing/test/UnitTests/Builder/RouteHandlerEndpointRouteBuilderExtensionsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ class FromRoute : Attribute, IFromRouteMetadata
11031103

11041104
class TestConsumesAttribute : Attribute, IAcceptsMetadata
11051105
{
1106-
public TestConsumesAttribute(Type requestType, string? contentType, params string[] otherContentTypes)
1106+
public TestConsumesAttribute(Type requestType, string contentType, params string[] otherContentTypes)
11071107
{
11081108
ArgumentNullException.ThrowIfNull(contentType);
11091109

src/Middleware/HttpLogging/src/MediaTypeOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ internal void AddText(MediaTypeHeaderValue mediaType)
4747
/// If charset is not specified in the contentType, the encoding will default to UTF-8.
4848
/// </remarks>
4949
/// <param name="contentType">The content type to add.</param>
50-
public void AddText(string? contentType)
50+
public void AddText(string contentType)
5151
{
5252
ArgumentNullException.ThrowIfNull(contentType);
5353

@@ -59,7 +59,7 @@ public void AddText(string? contentType)
5959
/// </summary>
6060
/// <param name="contentType">The content type to add.</param>
6161
/// <param name="encoding">The encoding to use.</param>
62-
public void AddText(string? contentType, Encoding encoding)
62+
public void AddText(string contentType, Encoding encoding)
6363
{
6464
ArgumentNullException.ThrowIfNull(contentType);
6565
ArgumentNullException.ThrowIfNull(encoding);

src/Mvc/Mvc.Core/src/ConsumesAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ConsumesAttribute :
3636
/// <param name="contentType">The request content type.</param>
3737
/// <param name="otherContentTypes">The additional list of allowed request content types.</param>
3838
/// </summary>
39-
public ConsumesAttribute(string? contentType, params string[] otherContentTypes)
39+
public ConsumesAttribute(string contentType, params string[] otherContentTypes)
4040
{
4141
ArgumentNullException.ThrowIfNull(contentType);
4242

@@ -59,7 +59,7 @@ public ConsumesAttribute(string? contentType, params string[] otherContentTypes)
5959
/// <param name="contentType">The request content type.</param>
6060
/// <param name="otherContentTypes">The additional list of allowed request content types.</param>
6161
/// </summary>
62-
public ConsumesAttribute(Type requestType, string? contentType, params string[] otherContentTypes)
62+
public ConsumesAttribute(Type requestType, string contentType, params string[] otherContentTypes)
6363
{
6464
ArgumentNullException.ThrowIfNull(contentType);
6565

src/Mvc/Mvc.Core/src/FileResult.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class FileResult : ActionResult
1919
/// the provided <paramref name="contentType"/>.
2020
/// </summary>
2121
/// <param name="contentType">The Content-Type header of the response.</param>
22-
protected FileResult(string? contentType)
22+
protected FileResult(string contentType)
2323
{
2424
ArgumentNullException.ThrowIfNull(contentType);
2525

src/Mvc/Mvc.Core/src/Formatters/FormatterMappings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class FormatterMappings
2121
/// </summary>
2222
/// <param name="format">The format value.</param>
2323
/// <param name="contentType">The media type for the format value.</param>
24-
public void SetMediaTypeMappingForFormat(string format, string? contentType)
24+
public void SetMediaTypeMappingForFormat(string format, string contentType)
2525
{
2626
ArgumentNullException.ThrowIfNull(format);
2727
ArgumentNullException.ThrowIfNull(contentType);
@@ -35,7 +35,7 @@ public void SetMediaTypeMappingForFormat(string format, string? contentType)
3535
/// </summary>
3636
/// <param name="format">The format value.</param>
3737
/// <param name="contentType">The media type for the format value.</param>
38-
public void SetMediaTypeMappingForFormat(string format, MediaTypeHeaderValue? contentType)
38+
public void SetMediaTypeMappingForFormat(string format, MediaTypeHeaderValue contentType)
3939
{
4040
ArgumentNullException.ThrowIfNull(format);
4141
ArgumentNullException.ThrowIfNull(contentType);

src/Mvc/Mvc.Core/src/Formatters/InputFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public virtual Task<InputFormatterResult> ReadAsync(InputFormatterContext contex
118118
public abstract Task<InputFormatterResult> ReadRequestBodyAsync(InputFormatterContext context);
119119

120120
/// <inheritdoc />
121-
public virtual IReadOnlyList<string>? GetSupportedContentTypes(string contentType, Type objectType)
121+
public virtual IReadOnlyList<string>? GetSupportedContentTypes(string? contentType, Type objectType)
122122
{
123123
if (SupportedMediaTypes.Count == 0)
124124
{

src/Mvc/Mvc.Core/src/ProducesResponseTypeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public ProducesResponseTypeAttribute(Type type, int statusCode)
4545
/// <param name="statusCode">The HTTP response status code.</param>
4646
/// <param name="contentType">The content type associated with the response.</param>
4747
/// <param name="additionalContentTypes">Additional content types supported by the response.</param>
48-
public ProducesResponseTypeAttribute(Type type, int statusCode, string? contentType, params string[] additionalContentTypes)
48+
public ProducesResponseTypeAttribute(Type type, int statusCode, string contentType, params string[] additionalContentTypes)
4949
{
5050
ArgumentNullException.ThrowIfNull(contentType);
5151

0 commit comments

Comments
 (0)