-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathAnyFieldMapParameter.cs
More file actions
40 lines (35 loc) · 1.17 KB
/
AnyFieldMapParameter.cs
File metadata and controls
40 lines (35 loc) · 1.17 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using System.Text.Json.Nodes;
using Microsoft.OpenApi.Models;
namespace Microsoft.OpenApi.Reader.ParseNodes
{
internal class AnyFieldMapParameter<T>
{
/// <summary>
/// Constructor.
/// </summary>
public AnyFieldMapParameter(
Func<T, JsonNode> propertyGetter,
Action<T, JsonNode> propertySetter,
Func<T, OpenApiSchema> SchemaGetter = null)
{
this.PropertyGetter = propertyGetter;
this.PropertySetter = propertySetter;
this.SchemaGetter = SchemaGetter;
}
/// <summary>
/// Function to retrieve the value of the property.
/// </summary>
public Func<T, JsonNode> PropertyGetter { get; }
/// <summary>
/// Function to set the value of the property.
/// </summary>
public Action<T, JsonNode> PropertySetter { get; }
/// <summary>
/// Function to get the schema to apply to the property.
/// </summary>
public Func<T, OpenApiSchema> SchemaGetter { get; }
}
}