Skip to content

Commit fab448a

Browse files
authored
Change contentType parameter in GetSupportedContentTypes to nullable (#63040)
1 parent e7ebb34 commit fab448a

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#nullable enable
2+
*REMOVED*Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestFormatMetadataProvider.GetSupportedContentTypes(string! contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
3+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestFormatMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
24
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider.Description.get -> string?
5+
*REMOVED*Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseTypeMetadataProvider.GetSupportedContentTypes(string! contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
6+
Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseTypeMetadataProvider.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
37
Microsoft.AspNetCore.Mvc.ProducesAttribute.Description.get -> string?
48
Microsoft.AspNetCore.Mvc.ProducesAttribute.Description.set -> void
59
Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.get -> string?
610
Microsoft.AspNetCore.Mvc.ProducesDefaultResponseTypeAttribute.Description.set -> void
711
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.get -> string?
812
Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute.Description.set -> void
13+
*REMOVED*virtual Microsoft.AspNetCore.Mvc.Formatters.InputFormatter.GetSupportedContentTypes(string! contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
14+
virtual Microsoft.AspNetCore.Mvc.Formatters.InputFormatter.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
15+
*REMOVED*virtual Microsoft.AspNetCore.Mvc.Formatters.OutputFormatter.GetSupportedContentTypes(string! contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?
16+
virtual Microsoft.AspNetCore.Mvc.Formatters.OutputFormatter.GetSupportedContentTypes(string? contentType, System.Type! objectType) -> System.Collections.Generic.IReadOnlyList<string!>?

0 commit comments

Comments
 (0)