Skip to content

Commit 84bbcd2

Browse files
committed
Change contentType parameter in GetSupportedContentTypes to nullable
1 parent 407f7ce commit 84bbcd2

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

src/Mvc/Mvc.Core/src/ApiExplorer/IApiRequestFormatMetadataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public interface IApiRequestFormatMetadataProvider
2525
/// </param>
2626
/// <returns>Content types which are supported by the <see cref="Formatters.IInputFormatter"/>.</returns>
2727
IReadOnlyList<string>? GetSupportedContentTypes(
28-
string contentType,
28+
string? contentType,
2929
Type objectType);
3030
}

src/Mvc/Mvc.Core/src/ApiExplorer/IApiResponseTypeMetadataProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public interface IApiResponseTypeMetadataProvider
2525
/// </param>
2626
/// <returns>Content types which are supported by the <see cref="Formatters.IOutputFormatter"/>.</returns>
2727
IReadOnlyList<string>? GetSupportedContentTypes(
28-
string contentType,
28+
string? contentType,
2929
Type objectType);
3030
}

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/Formatters/OutputFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected virtual bool CanWriteType(Type? type)
3030

3131
/// <inheritdoc />
3232
public virtual IReadOnlyList<string>? GetSupportedContentTypes(
33-
string contentType,
33+
string? contentType,
3434
Type objectType)
3535
{
3636
if (SupportedMediaTypes.Count == 0)

src/Mvc/Mvc.Core/src/PublicAPI.Unshipped.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.get ->
66
Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.set -> void
77
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.get -> string?
88
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.set -> void
9+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestFormatMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
10+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseTypeMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
11+
virtual Microsoft.AspNetCore.Mvc.Formatters.InputFormatter.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
12+
virtual Microsoft.AspNetCore.Mvc.Formatters.OutputFormatter.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?

0 commit comments

Comments
 (0)