forked from aspnet/Mvc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApiDescription.cs
64 lines (55 loc) · 2.51 KB
/
ApiDescription.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Microsoft.AspNetCore.Mvc.ApiExplorer
{
/// <summary>
/// Represents an API exposed by this application.
/// </summary>
public class ApiDescription
{
/// <summary>
/// Gets or sets <see cref="ActionDescriptor"/> for this api.
/// </summary>
public ActionDescriptor ActionDescriptor { get; set; }
/// <summary>
/// Gets or sets group name for this api.
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// Gets or sets the supported HTTP method for this api, or null if all HTTP methods are supported.
/// </summary>
public string HttpMethod { get; set; }
/// <summary>
/// Gets a list of <see cref="ApiParameterDescription"/> for this api.
/// </summary>
public IList<ApiParameterDescription> ParameterDescriptions { get; } = new List<ApiParameterDescription>();
/// <summary>
/// Gets arbitrary metadata properties associated with the <see cref="ApiDescription"/>.
/// </summary>
public IDictionary<object, object> Properties { get; } = new Dictionary<object, object>();
/// <summary>
/// Gets or sets relative url path template (relative to application root) for this api.
/// </summary>
public string RelativePath { get; set; }
/// <summary>
/// Gets the list of possible formats for a response.
/// </summary>
/// <remarks>
/// Will be empty if the action returns no response, or if the response type is unclear. Use
/// <c>ProducesAttribute</c> on an action method to specify a response type.
/// </remarks>
public IList<ApiRequestFormat> SupportedRequestFormats { get; } = new List<ApiRequestFormat>();
/// <summary>
/// Gets the list of possible formats for a response.
/// </summary>
/// <remarks>
/// Will be empty if the action returns no response, or if the response type is unclear. Use
/// <c>ProducesAttribute</c> on an action method to specify a response type.
/// </remarks>
public IList<ApiResponseType> SupportedResponseTypes { get; } = new List<ApiResponseType>();
}
}