-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathReDocOptions.cs
More file actions
49 lines (40 loc) · 1.56 KB
/
ReDocOptions.cs
File metadata and controls
49 lines (40 loc) · 1.56 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
using System.Text.Json;
namespace Swashbuckle.AspNetCore.ReDoc;
public class ReDocOptions
{
/// <summary>
/// Gets or sets a route prefix for accessing the redoc page
/// </summary>
public string RoutePrefix { get; set; } = "api-docs";
/// <summary>
/// Gets or sets a Stream function for retrieving the redoc page
/// </summary>
public Func<Stream> IndexStream { get; set; } = static () => ResourceHelper.GetEmbeddedResource("index.html");
/// <summary>
/// Gets or sets a title for the redoc page
/// </summary>
public string DocumentTitle { get; set; } = "API Docs";
/// <summary>
/// Gets or sets additional content to place in the head of the redoc page
/// </summary>
public string HeadContent { get; set; } = "";
/// <summary>
/// Gets or sets the Swagger JSON endpoint. Can be fully-qualified or relative to the redoc page
/// </summary>
public string SpecUrl { get; set; }
/// <summary>
/// Gets or sets the <see cref="ConfigObject"/> to use.
/// </summary>
public ConfigObject ConfigObject { get; set; } = new();
/// <summary>
/// Gets or sets the optional <see cref="System.Text.Json.JsonSerializerOptions"/> to use.
/// </summary>
public JsonSerializerOptions JsonSerializerOptions { get; set; }
/// <summary>
/// Gets or sets the cache lifetime to use for the ReDoc files, if any.
/// </summary>
/// <remarks>
/// The default value is 7 days.
/// </remarks>
public TimeSpan? CacheLifetime { get; set; } = TimeSpan.FromDays(7);
}