-
Notifications
You must be signed in to change notification settings - Fork 9.9k
/
IApiResponseTypeMetadataProvider.cs
30 lines (28 loc) · 1.29 KB
/
IApiResponseTypeMetadataProvider.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.AspNetCore.Mvc.ApiExplorer;
/// <summary>
/// Provides metadata information about the response format to an <c>IApiDescriptionProvider</c>.
/// </summary>
/// <remarks>
/// An <see cref="Formatters.IOutputFormatter"/> should implement this interface to expose metadata information
/// to an <c>IApiDescriptionProvider</c>.
/// </remarks>
public interface IApiResponseTypeMetadataProvider
{
/// <summary>
/// Gets a filtered list of content types which are supported by the <see cref="Formatters.IOutputFormatter"/>
/// for the <paramref name="objectType"/> and <paramref name="contentType"/>.
/// </summary>
/// <param name="contentType">
/// The content type for which the supported content types are desired, or <c>null</c> if any content
/// type can be used.
/// </param>
/// <param name="objectType">
/// The <see cref="Type"/> for which the supported content types are desired.
/// </param>
/// <returns>Content types which are supported by the <see cref="Formatters.IOutputFormatter"/>.</returns>
IReadOnlyList<string>? GetSupportedContentTypes(
string contentType,
Type objectType);
}