-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathOpenApiWriterSettings.cs
More file actions
35 lines (30 loc) · 1.07 KB
/
OpenApiWriterSettings.cs
File metadata and controls
35 lines (30 loc) · 1.07 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
using System;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Services;
namespace Microsoft.OpenApi.Writers
{
/// <summary>
/// Configuration settings to control how OpenAPI documents are written
/// </summary>
public class OpenApiWriterSettings
{
internal LoopDetector LoopDetector { get; } = new();
/// <summary>
/// Indicates if local references should be rendered as an inline object
/// </summary>
public bool InlineLocalReferences { get; set; }
/// <summary>
/// Indicates if external references should be rendered as an inline object
/// </summary>
public bool InlineExternalReferences { get; set; }
internal bool ShouldInlineReference(OpenApiReference reference)
{
return (reference.IsLocal && InlineLocalReferences)
|| (reference.IsExternal && InlineExternalReferences);
}
internal bool ShouldInlineReference()
{
return InlineLocalReferences || InlineExternalReferences;
}
}
}