Skip to content

Commit 9642bab

Browse files
Add default implementation to OpenAPI's new Description property to prevent a breaking change (#60937)
* Add default implementation to Description to prevent a breaking change when consumers cast this type and get exceptions about description being null * Apply suggestions from code review Co-authored-by: Safia Abdalla <safia@safia.rocks> * Set default implementation on Description in IApiResponseMetadataProvider to prevent casting errors --------- Co-authored-by: Safia Abdalla <safia@safia.rocks>
1 parent 00e50da commit 9642bab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/Http/Http.Abstractions/src/Metadata/IProducesResponseTypeMetadata.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public interface IProducesResponseTypeMetadata
2121
/// <summary>
2222
/// Gets the description of the response.
2323
/// </summary>
24-
string? Description { get; }
24+
string? Description => null;
2525

2626
/// <summary>
2727
/// Gets the content types supported by the metadata.

Diff for: src/Mvc/Mvc.Core/src/ApiExplorer/IApiResponseMetadataProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface IApiResponseMetadataProvider : IFilterMetadata
2020
/// <summary>
2121
/// Gets the description of the response.
2222
/// </summary>
23-
string? Description { get; }
23+
string? Description => null;
2424

2525
/// <summary>
2626
/// Gets the HTTP status code of the response.

0 commit comments

Comments
 (0)