Repository navigation
Expand file tree
/
Copy pathAsyncApiReaderSettings.cs
More file actions
61 lines (53 loc) · 2.09 KB
/
Copy pathAsyncApiReaderSettings.cs
File metadata and controls
61 lines (53 loc) · 2.09 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
52
53
54
55
56
57
58
59
60
61
// Copyright (c) The LEGO Group. All rights reserved.
namespace LEGO.AsyncAPI.Readers
{
using System;
using System.Collections.Generic;
using System.IO;
using LEGO.AsyncAPI.Models;
using LEGO.AsyncAPI.Models.Interfaces;
using LEGO.AsyncAPI.Readers.Interface;
using LEGO.AsyncAPI.Validations;
public enum ReferenceResolutionSetting
{
/// <summary>
/// Create placeholder objects with an AsyncApiReference instance and UnresolvedReference set to true.
/// </summary>
DoNotResolveReferences,
/// <summary>
/// Resolve internal component references and inline them.
/// </summary>
ResolveReferences,
}
/// <summary>
/// Configuration settings to control how AsyncApi documents are parsed.
/// </summary>
public class AsyncApiReaderSettings : AsyncApiSettings
{
/// <summary>
/// Indicates how references in the source document should be handled.
/// </summary>
public ReferenceResolutionSetting ReferenceResolution { get; set; } =
ReferenceResolutionSetting.ResolveReferences;
/// <summary>
/// Dictionary of parsers for converting extensions into strongly typed classes.
/// </summary>
public Dictionary<string, Func<AsyncApiAny, IAsyncApiExtension>>
ExtensionParsers
{ get; set; } =
new Dictionary<string, Func<AsyncApiAny, IAsyncApiExtension>>();
public IEnumerable<IBindingParser<IBinding>>
Bindings
{ get; set; } =
new List<IBindingParser<IBinding>>();
/// <summary>
/// Rules to use for validating AsyncApi specification. If none are provided a default set of rules are applied.
/// </summary>
public ValidationRuleSet RuleSet { get; set; } = ValidationRuleSet.GetDefaultRuleSet();
/// <summary>
/// Whether to leave the <see cref="Stream"/> object open after reading
/// from an <see cref="AsyncApiStreamReader"/> object.
/// </summary>
public bool LeaveStreamOpen { get; set; }
}
}