Skip to content

Commit 76bdb25

Browse files
Merge pull request #1 from Microsoft/master
sync
2 parents f1864c6 + 366b8c6 commit 76bdb25

File tree

61 files changed

+3184
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3184
-118
lines changed

src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net46; netstandard2.0</TargetFrameworks>
44
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -10,7 +10,7 @@
1010
<Company>Microsoft</Company>
1111
<Title>Microsoft.OpenApi.Readers</Title>
1212
<PackageId>Microsoft.OpenApi.Readers</PackageId>
13-
<Version>1.1.0</Version>
13+
<Version>1.1.1</Version>
1414
<Description>OpenAPI.NET Readers for JSON and YAML documents</Description>
1515
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1616
<PackageTags>OpenAPI .NET</PackageTags>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System.Collections.Generic;
5+
6+
namespace Microsoft.OpenApi.Readers.ParseNodes
7+
{
8+
internal class AnyFieldMap<T> : Dictionary<string, AnyFieldMapParameter<T>>
9+
{
10+
}
11+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System;
5+
using Microsoft.OpenApi.Any;
6+
using Microsoft.OpenApi.Models;
7+
8+
namespace Microsoft.OpenApi.Readers.ParseNodes
9+
{
10+
internal class AnyFieldMapParameter<T>
11+
{
12+
/// <summary>
13+
/// Constructor.
14+
/// </summary>
15+
public AnyFieldMapParameter(
16+
Func<T, IOpenApiAny> propertyGetter,
17+
Action<T, IOpenApiAny> propertySetter,
18+
Func<T, OpenApiSchema> schemaGetter)
19+
{
20+
this.PropertyGetter = propertyGetter;
21+
this.PropertySetter = propertySetter;
22+
this.SchemaGetter = schemaGetter;
23+
}
24+
25+
/// <summary>
26+
/// Function to retrieve the value of the property.
27+
/// </summary>
28+
public Func<T, IOpenApiAny> PropertyGetter { get; }
29+
30+
/// <summary>
31+
/// Function to set the value of the property.
32+
/// </summary>
33+
public Action<T, IOpenApiAny> PropertySetter { get; }
34+
35+
/// <summary>
36+
/// Function to get the schema to apply to the property.
37+
/// </summary>
38+
public Func<T, OpenApiSchema> SchemaGetter { get; }
39+
}
40+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System.Collections.Generic;
5+
6+
namespace Microsoft.OpenApi.Readers.ParseNodes
7+
{
8+
internal class AnyListFieldMap<T> : Dictionary<string, AnyListFieldMapParameter<T>>
9+
{
10+
11+
}
12+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using Microsoft.OpenApi.Any;
7+
using Microsoft.OpenApi.Models;
8+
9+
namespace Microsoft.OpenApi.Readers.ParseNodes
10+
{
11+
internal class AnyListFieldMapParameter<T>
12+
{
13+
/// <summary>
14+
/// Constructor
15+
/// </summary>
16+
public AnyListFieldMapParameter(
17+
Func<T, IList<IOpenApiAny>> propertyGetter,
18+
Action<T, IList<IOpenApiAny>> propertySetter,
19+
Func<T, OpenApiSchema> schemaGetter)
20+
{
21+
this.PropertyGetter = propertyGetter;
22+
this.PropertySetter = propertySetter;
23+
this.SchemaGetter = schemaGetter;
24+
}
25+
26+
/// <summary>
27+
/// Function to retrieve the value of the property.
28+
/// </summary>
29+
public Func<T, IList<IOpenApiAny>> PropertyGetter { get; }
30+
31+
/// <summary>
32+
/// Function to set the value of the property.
33+
/// </summary>
34+
public Action<T, IList<IOpenApiAny>> PropertySetter { get; }
35+
36+
/// <summary>
37+
/// Function to get the schema to apply to the property.
38+
/// </summary>
39+
public Func<T, OpenApiSchema> SchemaGetter { get; }
40+
}
41+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System.Collections.Generic;
5+
6+
namespace Microsoft.OpenApi.Readers.ParseNodes
7+
{
8+
internal class AnyMapFieldMap<T, U> : Dictionary<string, AnyMapFieldMapParameter<T, U>>
9+
{
10+
11+
}
12+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using Microsoft.OpenApi.Any;
7+
using Microsoft.OpenApi.Interfaces;
8+
using Microsoft.OpenApi.Models;
9+
10+
namespace Microsoft.OpenApi.Readers.ParseNodes
11+
{
12+
internal class AnyMapFieldMapParameter<T, U>
13+
{
14+
/// <summary>
15+
/// Constructor
16+
/// </summary>
17+
public AnyMapFieldMapParameter(
18+
Func<T, IDictionary<string, U>> propertyMapGetter,
19+
Func<U, IOpenApiAny> propertyGetter,
20+
Action<U, IOpenApiAny> propertySetter,
21+
Func<T, OpenApiSchema> schemaGetter)
22+
{
23+
this.PropertyMapGetter = propertyMapGetter;
24+
this.PropertyGetter = propertyGetter;
25+
this.PropertySetter = propertySetter;
26+
this.SchemaGetter = schemaGetter;
27+
}
28+
29+
/// <summary>
30+
/// Function to retrieve the property that is a map from string to an inner element containing IOpenApiAny.
31+
/// </summary>
32+
public Func<T, IDictionary<string, U>> PropertyMapGetter { get; }
33+
34+
/// <summary>
35+
/// Function to retrieve the value of the property from an inner element.
36+
/// </summary>
37+
public Func<U, IOpenApiAny> PropertyGetter { get; }
38+
39+
/// <summary>
40+
/// Function to set the value of the property.
41+
/// </summary>
42+
public Action<U, IOpenApiAny> PropertySetter { get; }
43+
44+
/// <summary>
45+
/// Function to get the schema to apply to the property.
46+
/// </summary>
47+
public Func<T, OpenApiSchema> SchemaGetter { get; }
48+
}
49+
}

0 commit comments

Comments
 (0)