HelpPageApiModel.cshtml
1.42 KB
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
@using System.Web.Http
@using AIAHTML5.ADMIN.API.Areas.HelpPage.Models
@model HelpPageApiModel
@{
var description = Model.ApiDescription;
bool hasParameters = description.ParameterDescriptions.Count > 0;
bool hasRequestSamples = Model.SampleRequests.Count > 0;
bool hasResponseSamples = Model.SampleResponses.Count > 0;
}
<h1>@description.HttpMethod.Method @description.RelativePath</h1>
<div>
@if (description.Documentation != null)
{
<p>@description.Documentation</p>
}
else
{
<p>No documentation available.</p>
}
@if (hasParameters || hasRequestSamples)
{
<h2>Request Information</h2>
if (hasParameters)
{
<h3>Parameters</h3>
@Html.DisplayFor(apiModel => apiModel.ApiDescription.ParameterDescriptions, "Parameters")
}
if (hasRequestSamples)
{
<h3>Request body formats</h3>
@Html.DisplayFor(apiModel => apiModel.SampleRequests, "Samples")
}
}
@if (hasResponseSamples)
{
<h2>Response Information</h2>
if (description.ResponseDescription.Documentation != null)
{
<p>@description.ResponseDescription.Documentation</p>
}
else
{
<p>No documentation available.</p>
}
<h3>Response body formats</h3>
@Html.DisplayFor(apiModel => apiModel.SampleResponses, "Samples")
}
</div>