This repository was archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathSchemaGenerationSettings.cs
48 lines (42 loc) · 1.87 KB
/
SchemaGenerationSettings.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
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
using System;
namespace Microsoft.OpenApi.CSharpAnnotations.DocumentGeneration
{
/// <summary>
/// Specifies the settings for schema generation.
/// </summary>
[Serializable]
public class SchemaGenerationSettings
{
/// <summary>
/// Creates an instance of <see cref="SchemaGenerationSettings"/> class.
/// </summary>
/// <param name="propertyNameResolver">The property name resolver.</param>
/// <param name="schemaIdResolver"></param>
public SchemaGenerationSettings(IPropertyNameResolver propertyNameResolver, ISchemaIdResolver schemaIdResolver = null)
{
PropertyNameResolver = propertyNameResolver
?? throw new ArgumentNullException(nameof(propertyNameResolver));
SchemaIdResolver = schemaIdResolver ?? new DefaultSchemaIdResolver();
}
/// <summary>
/// Gets the property name resolver.
/// </summary>
public IPropertyNameResolver PropertyNameResolver { get; }
/// <summary>
/// Gets the schema identifier resolver.
/// </summary>
public ISchemaIdResolver SchemaIdResolver { get; }
/// <summary>
/// Gets or sets a value indicating whether generator should support inheritance, i.e add allOf and oneOf attributes.
/// </summary>
public bool IncludeInheritanceInformation { get; set; }
/// <summary>
/// Gets or sets the discriminator resolver.
/// </summary>
public IDiscriminatorResolver DiscriminatorResolver { get; set; }
}
}