Skip to content

Commit f1af891

Browse files
authored
Merge pull request #439 from microsoft/dm/OpenApiComparer
Update vnext and temporarily skip failing comparer tests
2 parents 8c7b7ef + 5e0c6a7 commit f1af891

File tree

103 files changed

+4681
-363
lines changed

Some content is hidden

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

103 files changed

+4681
-363
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
![Category overview screenshot](docs/images/oainet.png "Microsoft + OpenAPI = Love")
22

3-
# OpenAPI.NET
3+
# OpenAPI.NET
4+
5+
|Package|Nuget|
6+
|--|--|
7+
|Models and Writers|[![nuget](https://img.shields.io/nuget/v/Microsoft.OpenApi.svg)](https://www.nuget.org/packages/Microsoft.OpenApi/) |
8+
|Readers | [![nuget](https://img.shields.io/nuget/v/Microsoft.OpenApi.Readers.svg)](https://www.nuget.org/packages/Microsoft.OpenApi.Readers/) |
9+
410

511
The **OpenAPI.NET** SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model.
612

build.cmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ SET VERSION=%~1
66
Echo Building Microsoft.OpenApi
77

88
SET PROJ=%~dp0src\Microsoft.OpenApi\Microsoft.OpenApi.csproj
9-
msbuild %PROJ% /t:restore /p:Configuration=Release
10-
msbuild %PROJ% /t:build /p:Configuration=Release
11-
msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts;Version=%VERSION%
9+
dotnet build %PROJ% /t:restore /p:Configuration=Release
10+
dotnet build %PROJ% /t:build /p:Configuration=Release
11+
dotnet build %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts;Version=%VERSION%
1212

1313
Echo Building Microsoft.OpenApi.Readers
1414

1515
SET PROJ=%~dp0src\Microsoft.OpenApi.Readers\Microsoft.OpenApi.Readers.csproj
16-
msbuild %PROJ% /t:restore /p:Configuration=Release
17-
msbuild %PROJ% /t:build /p:Configuration=Release
18-
msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts;Version=%VERSION%
16+
dotnet build %PROJ% /t:restore /p:Configuration=Release
17+
dotnet build %PROJ% /t:build /p:Configuration=Release
18+
dotnet build %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts;Version=%VERSION%
1919

2020
goto :end
2121
:error

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Company>Microsoft</Company>
1111
<Title>Microsoft.OpenApi.Readers</Title>
1212
<PackageId>Microsoft.OpenApi.Readers</PackageId>
13-
<Version>1.1.1</Version>
13+
<Version>1.1.4</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)