Skip to content

Commit d8f1415

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

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)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#nullable enable
2+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestFormatMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
23
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider.Description.get -> string?
4+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseTypeMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
35
Microsoft.AspNetCore.Mvc.ProducesAttribute.Description.get -> string?
46
Microsoft.AspNetCore.Mvc.ProducesAttribute.Description.set -> void
57
Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.get -> string?
68
Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.set -> void
79
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.get -> string?
810
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.set -> void
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)