Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 91be0e4

Browse files
committed
remove classes and references related to openapi.net package
1 parent 85c44d2 commit 91be0e4

File tree

6 files changed

+13
-98
lines changed

6 files changed

+13
-98
lines changed

src/APIM_ARMTemplate/apimtemplate.test/Common/FileHandlerTests/OpenAPISpecReaderTests.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/APIM_ARMTemplate/apimtemplate.test/Creator/TemplateCreatorTests/APITemplateCreatorTests.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Microsoft.OpenApi.Models;
2-
using Xunit;
1+
using Xunit;
32
using Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common;
43
using Microsoft.Azure.Management.ApiManagement.ArmTemplates.Create;
54
using System.Collections.Generic;
@@ -40,7 +39,9 @@ public async void ShouldCreateInitialAPITemplateResourceFromCreatorConfig()
4039
subscriptionKeyRequired = true
4140
},
4241
openApiSpec = "https://petstore.swagger.io/v2/swagger.json",
43-
protocols = "https"
42+
protocols = "https",
43+
isCurrent = true,
44+
type = "http"
4445
};
4546
creatorConfig.apis.Add(api);
4647

@@ -52,6 +53,9 @@ public async void ShouldCreateInitialAPITemplateResourceFromCreatorConfig()
5253
Assert.Equal(api.name, apiTemplateResource.properties.displayName);
5354
Assert.Equal(api.apiVersion, apiTemplateResource.properties.apiVersion);
5455
Assert.Equal(api.apiVersionDescription, apiTemplateResource.properties.apiVersionDescription);
56+
Assert.Equal(api.type, apiTemplateResource.properties.type);
57+
Assert.Equal(api.type, apiTemplateResource.properties.apiType);
58+
Assert.Equal(api.isCurrent, apiTemplateResource.properties.isCurrent);
5559
Assert.Equal(new string[] { api.protocols }, apiTemplateResource.properties.protocols);
5660
Assert.Equal($"[resourceId('Microsoft.ApiManagement/service/apiVersionSets', parameters('ApimServiceName'), '{api.apiVersionSetId}')]", apiTemplateResource.properties.apiVersionSetId);
5761
Assert.Equal(api.apiRevision, apiTemplateResource.properties.apiRevision);
@@ -118,7 +122,9 @@ public async void ShouldCreateUnifiedAPITemplateResourceFromCreatorConfig()
118122
subscriptionKeyRequired = true
119123
},
120124
openApiSpec = "https://petstore.swagger.io/v2/swagger.json",
121-
protocols = "https"
125+
protocols = "https",
126+
isCurrent = true,
127+
type = "http"
122128
};
123129
creatorConfig.apis.Add(api);
124130

@@ -129,6 +135,9 @@ public async void ShouldCreateUnifiedAPITemplateResourceFromCreatorConfig()
129135
Assert.Equal($"[concat(parameters('ApimServiceName'), '/{api.name}')]", apiTemplateResource.name);
130136
Assert.Equal(api.name, apiTemplateResource.properties.displayName);
131137
Assert.Equal(api.apiVersion, apiTemplateResource.properties.apiVersion);
138+
Assert.Equal(api.type, apiTemplateResource.properties.type);
139+
Assert.Equal(api.type, apiTemplateResource.properties.apiType);
140+
Assert.Equal(api.isCurrent, apiTemplateResource.properties.isCurrent);
132141
Assert.Equal(new string[] { api.protocols }, apiTemplateResource.properties.protocols);
133142
Assert.Equal(api.apiVersionDescription, apiTemplateResource.properties.apiVersionDescription);
134143
Assert.Equal($"[resourceId('Microsoft.ApiManagement/service/apiVersionSets', parameters('ApimServiceName'), '{api.apiVersionSetId}')]", apiTemplateResource.properties.apiVersionSetId);

src/APIM_ARMTemplate/apimtemplate.test/apimtemplate.test.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>
2020
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
21-
<PackageReference Include="Microsoft.OpenApi" Version="1.1.2" />
22-
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.1.2" />
2321
<PackageReference Include="xunit" Version="2.4.0" />
2422
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
2523
</ItemGroup>

src/APIM_ARMTemplate/apimtemplate/Common/FileHandlers/OpenAPISpecReader.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/APIM_ARMTemplate/apimtemplate/Creator/TemplateCreators/APITemplateCreator.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Collections.Generic;
22
using System.Threading.Tasks;
33
using Newtonsoft.Json;
4-
using Microsoft.OpenApi.Models;
54
using System;
65
using Microsoft.Azure.Management.ApiManagement.ArmTemplates.Common;
76

@@ -119,10 +118,6 @@ public async Task<APITemplateResource> CreateAPITemplateResourceAsync(APIConfig
119118
if (!isSplit || isInitial)
120119
{
121120
// add metadata properties for initial and unified templates
122-
// protocols can be pulled by converting the OpenApiSpec into the OpenApiDocument class
123-
OpenAPISpecReader openAPISpecReader = new OpenAPISpecReader();
124-
OpenApiDocument doc = await openAPISpecReader.ConvertOpenAPISpecToDoc(api.openApiSpec);
125-
// supplied via optional arguments
126121
apiTemplateResource.properties.apiVersion = api.apiVersion;
127122
apiTemplateResource.properties.serviceUrl = api.serviceUrl;
128123
apiTemplateResource.properties.type = api.type;

src/APIM_ARMTemplate/apimtemplate/apimtemplate.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
3030
<PackageReference Include="Colors.Net" Version="1.1.0" />
3131
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.5" />
32-
<PackageReference Include="Microsoft.OpenApi" Version="1.1.2" />
33-
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.1.2" />
3432
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
3533
<PackageReference Include="YamlDotNet" Version="5.3.0" />
3634
</ItemGroup>

0 commit comments

Comments
 (0)