.NET 7 support for out-of-process worker (#522)
This commit is contained in:
Родитель
238a039c25
Коммит
5f05f0ad00
|
@ -28,6 +28,11 @@ jobs:
|
|||
with:
|
||||
dotnet-version: '6.x'
|
||||
|
||||
- name: Setup .NET SDK 7 STS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '7.x'
|
||||
|
||||
- name: Restore NuGet packages
|
||||
shell: pwsh
|
||||
run: |
|
||||
|
|
|
@ -36,21 +36,26 @@ jobs:
|
|||
run: |
|
||||
npm install -g azure-functions-core-tools@4 --unsafe-perm true
|
||||
|
||||
- name: Setup .NET SDK 3.1 LTS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
# - name: Setup .NET SDK 3.1 LTS
|
||||
# uses: actions/setup-dotnet@v1
|
||||
# with:
|
||||
# dotnet-version: '3.1.x'
|
||||
|
||||
- name: Setup .NET SDK 5
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.x'
|
||||
# - name: Setup .NET SDK 5
|
||||
# uses: actions/setup-dotnet@v1
|
||||
# with:
|
||||
# dotnet-version: '5.x'
|
||||
|
||||
- name: Setup .NET SDK 6 LTS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '6.x'
|
||||
|
||||
- name: Setup .NET SDK 7 STS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '7.x'
|
||||
|
||||
# - name: Add MSBuild to PATH
|
||||
# uses: microsoft/setup-msbuild@v1.0.0
|
||||
|
||||
|
|
|
@ -30,21 +30,26 @@ jobs:
|
|||
run: |
|
||||
npm install -g azure-functions-core-tools@4 --unsafe-perm true
|
||||
|
||||
- name: Setup .NET SDK 3.1 LTS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
# - name: Setup .NET SDK 3.1 LTS
|
||||
# uses: actions/setup-dotnet@v1
|
||||
# with:
|
||||
# dotnet-version: '3.1.x'
|
||||
|
||||
- name: Setup .NET SDK 5
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '5.x'
|
||||
# - name: Setup .NET SDK 5
|
||||
# uses: actions/setup-dotnet@v1
|
||||
# with:
|
||||
# dotnet-version: '5.x'
|
||||
|
||||
- name: Setup .NET SDK 6 LTS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '6.x'
|
||||
|
||||
- name: Setup .NET SDK 7 STS
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: '7.x'
|
||||
|
||||
# - name: Add MSBuild to PATH
|
||||
# uses: microsoft/setup-msbuild@v1.0.0
|
||||
|
||||
|
|
|
@ -22,8 +22,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.OpenApi", "src\Microsoft.Azure.WebJobs.Extensions.OpenApi\Microsoft.Azure.WebJobs.Extensions.OpenApi.csproj", "{D405655F-C8BE-4134-893C-ADB4918B0624}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI", "src\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.csproj", "{7AD094AA-01D6-4644-B9B6-E555A029D6D7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{66D8DEA8-B477-497F-95BB-E8F9A5BAC352}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Functions.Worker.Extensions.OpenApi.FunctionApp.OutOfProc", "samples\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.FunctionApp.OutOfProc\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.FunctionApp.OutOfProc.csproj", "{7FD0AC53-E04D-41C6-9633-924A0D98A114}"
|
||||
|
@ -48,8 +46,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Ext
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.OpenApi.Tests", "test\Microsoft.Azure.WebJobs.Extensions.OpenApi.Tests\Microsoft.Azure.WebJobs.Extensions.OpenApi.Tests.csproj", "{D787694D-B87B-4E11-9455-B5BF9306D8FC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests", "test\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests.csproj", "{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test-integration", "test-integration", "{CBD9883B-134F-42CC-A201-EE06EBC48C3E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp", "test-integration\Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp\Microsoft.Azure.WebJobs.Extensions.OpenApi.TestApp.csproj", "{7F6EC289-B516-455E-8E5F-324D5C9212B7}"
|
||||
|
@ -78,10 +74,6 @@ Global
|
|||
{D405655F-C8BE-4134-893C-ADB4918B0624}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D405655F-C8BE-4134-893C-ADB4918B0624}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D405655F-C8BE-4134-893C-ADB4918B0624}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7AD094AA-01D6-4644-B9B6-E555A029D6D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7AD094AA-01D6-4644-B9B6-E555A029D6D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7AD094AA-01D6-4644-B9B6-E555A029D6D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7AD094AA-01D6-4644-B9B6-E555A029D6D7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7FD0AC53-E04D-41C6-9633-924A0D98A114}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7FD0AC53-E04D-41C6-9633-924A0D98A114}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7FD0AC53-E04D-41C6-9633-924A0D98A114}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -122,10 +114,6 @@ Global
|
|||
{D787694D-B87B-4E11-9455-B5BF9306D8FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D787694D-B87B-4E11-9455-B5BF9306D8FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D787694D-B87B-4E11-9455-B5BF9306D8FC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{65AED6F0-D27E-4D6E-BA42-AD6EE1338082}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7F6EC289-B516-455E-8E5F-324D5C9212B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7F6EC289-B516-455E-8E5F-324D5C9212B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7F6EC289-B516-455E-8E5F-324D5C9212B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -143,7 +131,6 @@ Global
|
|||
{64A22A3C-D0C4-4DE9-A8D5-2CEF766EB500} = {810145E0-41CF-4E24-BD9C-E7517498BA29}
|
||||
{B18937F6-B39F-46BB-BB3C-86C0693993EF} = {810145E0-41CF-4E24-BD9C-E7517498BA29}
|
||||
{D405655F-C8BE-4134-893C-ADB4918B0624} = {810145E0-41CF-4E24-BD9C-E7517498BA29}
|
||||
{7AD094AA-01D6-4644-B9B6-E555A029D6D7} = {810145E0-41CF-4E24-BD9C-E7517498BA29}
|
||||
{66D8DEA8-B477-497F-95BB-E8F9A5BAC352} = {810145E0-41CF-4E24-BD9C-E7517498BA29}
|
||||
{7FD0AC53-E04D-41C6-9633-924A0D98A114} = {66D8DEA8-B477-497F-95BB-E8F9A5BAC352}
|
||||
{1E7232C2-8560-4030-9B5D-AD88A1680F62} = {66D8DEA8-B477-497F-95BB-E8F9A5BAC352}
|
||||
|
@ -155,7 +142,6 @@ Global
|
|||
{1D1A5ED5-A1A1-4082-ACAF-30079AF31AC6} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC}
|
||||
{968CD847-80D0-4740-92D5-F5553461EC04} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC}
|
||||
{D787694D-B87B-4E11-9455-B5BF9306D8FC} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC}
|
||||
{65AED6F0-D27E-4D6E-BA42-AD6EE1338082} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC}
|
||||
{CBD9883B-134F-42CC-A201-EE06EBC48C3E} = {8B62E3FB-9062-4716-803A-1FA51FCE68BC}
|
||||
{7F6EC289-B516-455E-8E5F-324D5C9212B7} = {CBD9883B-134F-42CC-A201-EE06EBC48C3E}
|
||||
{8324C8D1-A9FD-4F98-8ED9-82C3BE572DBB} = {CBD9883B-134F-42CC-A201-EE06EBC48C3E}
|
||||
|
|
|
@ -2,21 +2,26 @@ parameters:
|
|||
configuration: ''
|
||||
|
||||
steps:
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .NET Core SDK 3.1 LTS'
|
||||
inputs:
|
||||
version: '3.1.x'
|
||||
# - task: UseDotNet@2
|
||||
# displayName: 'Install .NET Core SDK 3.1 LTS'
|
||||
# inputs:
|
||||
# version: '3.1.x'
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .NET SDK 5'
|
||||
inputs:
|
||||
version: '5.x'
|
||||
# - task: UseDotNet@2
|
||||
# displayName: 'Install .NET SDK 5'
|
||||
# inputs:
|
||||
# version: '5.x'
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .NET Core SDK 6 LTS'
|
||||
inputs:
|
||||
version: '6.x'
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .NET Core SDK 7 STS'
|
||||
inputs:
|
||||
version: '7.x'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: '.NET Restore'
|
||||
inputs:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
<!--<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.4.0" />
|
||||
</ItemGroup>-->
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
||||
|
@ -11,13 +11,13 @@
|
|||
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
<!--<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.OpenApi" Version="1.4.0" />
|
||||
</ItemGroup>-->
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.3.0" OutputItemType="Analyzer" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.6.0" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" OutputItemType="Analyzer" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.10.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Comment this block if you want to use NuGet package from https://nuget.org -->
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
<!--<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.2.0" />
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.4.0" />
|
||||
</ItemGroup>-->
|
||||
<!-- Uncomment this block if you want to use NuGet package from https://nuget.org -->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.2" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Comment this block if you want to use NuGet package from https://nuget.org -->
|
||||
|
|
|
@ -2,6 +2,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Internal;
|
||||
using Microsoft.AspNetCore.WebUtilities;
|
||||
using Microsoft.Azure.Functions.Worker.Http;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions;
|
||||
|
@ -62,7 +63,7 @@ namespace Microsoft.Azure.Functions.Worker.Extensions.OpenApi.Extensions
|
|||
{
|
||||
queries = new Dictionary<string, StringValues>();
|
||||
}
|
||||
|
||||
|
||||
return new QueryCollection(queries);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\builds\worker.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<IsPackable>true</IsPackable>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
|
@ -22,20 +22,20 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DocumentationFile>bin\Debug\net5.0\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.xml</DocumentationFile>
|
||||
<DocumentationFile>bin\Debug\netstandard2.0\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DocumentationFile>bin\Release\net5.0\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.xml</DocumentationFile>
|
||||
<DocumentationFile>bin\Release\netstandard2.0\Microsoft.Azure.Functions.Worker.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<!--<FrameworkReference Include="Microsoft.AspNetCore.App" />-->
|
||||
<PackageReference Include="Microsoft.Azure.Core.NewtonsoftJson" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.12" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Core" Version="1.1.0" />
|
||||
<!-- <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.0.0" /> -->
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Core" Version="1.8.0" />
|
||||
<!--<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.1.0" />-->
|
||||
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
|
||||
<PackageReference Include="YamlDotNet" Version="12.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
bin/
|
||||
obj/
|
||||
Properties/
|
||||
*.csproj
|
||||
*.csproj.user
|
||||
*.cs
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/azfuncopenapi.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/Aliencube.AzureFunctions.Extensions.OpenApi.CLI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Aliencube.AzureFunctions.Extensions.OpenApi.CLI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/Aliencube.AzureFunctions.Extensions.OpenApi.CLI.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\builds\webjobs.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AssemblyName>azfuncopenapi</AssemblyName>
|
||||
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Cocona.Lite" Version="1.4.0" />
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.32" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
|
||||
<PackageReference Include="System.Runtime.Handles" Version="4.3.0" />
|
||||
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.Azure.WebJobs.Extensions.OpenApi\Microsoft.Azure.WebJobs.Extensions.OpenApi.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,114 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Cocona;
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Abstractions;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Configurations;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Enums;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Visitors;
|
||||
|
||||
using Moq;
|
||||
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents the console app entity.
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
private static readonly char directorySeparator = Path.DirectorySeparatorChar;
|
||||
|
||||
/// <summary>
|
||||
/// Invokes the console app.
|
||||
/// </summary>
|
||||
/// <param name="args">List of arguments.</param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CoconaLiteApp.Run<Program>(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates the OpenAPI document.
|
||||
/// </summary>
|
||||
/// <param name="project">Project path.</param>
|
||||
/// <param name="configuration">Copile configuration.</param>
|
||||
/// <param name="version">OpenAPI version.</param>
|
||||
/// <param name="format">OpenAPI output format.</param>
|
||||
/// <param name="output">Output path.</param>
|
||||
/// <param name="console">Value indicating whether to render the document on console or not.</param>
|
||||
public void Generate(
|
||||
[Option('p', Description = "Project path. Default is current directory")] string project = ".",
|
||||
[Option('c', Description = "Configuration. Default is 'Debug'")] string configuration = "Debug",
|
||||
[Option('t', Description = "Target framework. Default is 'netcoreapp2.1'")] string target = "netcoreapp2.1",
|
||||
[Option('v', Description = "OpenAPI spec version. Value can be either 'v2' or 'v3'. Default is 'v2'")] OpenApiVersionType version = OpenApiVersionType.V2,
|
||||
[Option('f', Description = "OpenAPI output format. Value can be either 'json' or 'yaml'. Default is 'yaml'")] OpenApiFormatType format = OpenApiFormatType.Json,
|
||||
[Option('o', Description = "Generated OpenAPI output location. Default is 'output'")] string output = "output",
|
||||
bool console = false)
|
||||
{
|
||||
var pi = default(ProjectInfo);
|
||||
try
|
||||
{
|
||||
pi = new ProjectInfo(project, configuration, target);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var req = new Mock<IHttpRequestDataObject>();
|
||||
req.SetupGet(p => p.Scheme).Returns("http");
|
||||
req.SetupGet(p => p.Host).Returns(new HostString("localhost", 7071));
|
||||
|
||||
var filter = new RouteConstraintFilter();
|
||||
var acceptor = new OpenApiSchemaAcceptor();
|
||||
var namingStrategy = new CamelCaseNamingStrategy();
|
||||
var collection = VisitorCollection.CreateInstance();
|
||||
var helper = new DocumentHelper(filter, acceptor);
|
||||
var document = new Document(helper);
|
||||
|
||||
var swagger = default(string);
|
||||
try
|
||||
{
|
||||
swagger = document.InitialiseDocument()
|
||||
.AddMetadata(pi.OpenApiInfo)
|
||||
.AddServer(req.Object, pi.HostJsonHttpSettings.RoutePrefix)
|
||||
.AddNamingStrategy(namingStrategy)
|
||||
.AddVisitors(collection)
|
||||
.Build(pi.CompiledDllPath)
|
||||
.RenderAsync(version.ToOpenApiSpecVersion(), format.ToOpenApiFormat())
|
||||
.Result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
}
|
||||
|
||||
if (console)
|
||||
{
|
||||
Console.WriteLine(swagger);
|
||||
}
|
||||
|
||||
var outputpath = Path.IsPathFullyQualified(output)
|
||||
? output
|
||||
: $"{pi.CompiledPath}{directorySeparator}{output}";
|
||||
|
||||
if (!Directory.Exists(outputpath))
|
||||
{
|
||||
Directory.CreateDirectory(outputpath);
|
||||
}
|
||||
|
||||
File.WriteAllText($"{outputpath}{directorySeparator}swagger.{format.ToDisplayName()}", swagger, Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,247 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Configurations.AppSettings.Extensions;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Abstractions;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Configurations;
|
||||
using Microsoft.Azure.WebJobs.Extensions.OpenApi.Core.Extensions;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI
|
||||
{
|
||||
/// <summary>
|
||||
/// This represents the project info entity.
|
||||
/// </summary>
|
||||
public class ProjectInfo
|
||||
{
|
||||
private static readonly char directorySeparator = System.IO.Path.DirectorySeparatorChar;
|
||||
|
||||
private string _projectPath;
|
||||
private string _filename;
|
||||
private string _configuration;
|
||||
private string _targetFramework;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProjectInfo"/> class.
|
||||
/// </summary>
|
||||
public ProjectInfo()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ProjectInfo"/> class.
|
||||
/// </summary>
|
||||
/// <param name="projectPath">Project path.</param>
|
||||
/// <param name="configuration">Configuration value.</param>
|
||||
/// <param name="targetFramework">Target framework.</param>
|
||||
public ProjectInfo(string projectPath, string configuration, string targetFramework)
|
||||
{
|
||||
this.SetProjectPath(projectPath.ThrowIfNullOrWhiteSpace());
|
||||
this._configuration = configuration.ThrowIfNullOrWhiteSpace();
|
||||
this._targetFramework = targetFramework.ThrowIfNullOrWhiteSpace();
|
||||
|
||||
this.SetHostSettings();
|
||||
this.SetOpenApiInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the fully qualified project path.
|
||||
/// </summary>
|
||||
public virtual string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._projectPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.SetProjectPath(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the compile configuration value.
|
||||
/// </summary>
|
||||
public virtual string Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._configuration;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._configuration = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the compile target framework value.
|
||||
/// </summary>
|
||||
public virtual string TargetFramework
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._targetFramework;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._targetFramework = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the project filename, ie) *.csproj
|
||||
/// </summary>
|
||||
public virtual string Filename
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._filename;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified compiled directory path.
|
||||
/// </summary>
|
||||
public virtual string CompiledPath
|
||||
{
|
||||
get
|
||||
{
|
||||
this.Path.ThrowIfNullOrWhiteSpace();
|
||||
this.Configuration.ThrowIfNullOrWhiteSpace();
|
||||
this.TargetFramework.ThrowIfNullOrWhiteSpace();
|
||||
|
||||
return $"{this.Path.TrimEnd(directorySeparator)}{directorySeparator}bin{directorySeparator}{this.Configuration}{directorySeparator}{this.TargetFramework}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified compiled .dll file path.
|
||||
/// </summary>
|
||||
public virtual string CompiledDllPath
|
||||
{
|
||||
get
|
||||
{
|
||||
this.CompiledPath.ThrowIfNullOrWhiteSpace();
|
||||
this.Filename.ThrowIfNullOrWhiteSpace();
|
||||
|
||||
return $"{this.CompiledPath}{directorySeparator}bin{directorySeparator}{this.Filename}".Replace(".csproj", ".dll");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified file path of host.json.
|
||||
/// </summary>
|
||||
public virtual string HostJsonPath
|
||||
{
|
||||
get
|
||||
{
|
||||
this.CompiledPath.ThrowIfNullOrWhiteSpace();
|
||||
|
||||
return $"{this.CompiledPath}{directorySeparator}host.json";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the host.json settings.
|
||||
/// </summary>
|
||||
public virtual IConfiguration HostSettings { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTTP settings in host.json.
|
||||
/// </summary>
|
||||
public virtual HttpSettings HostJsonHttpSettings { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="OpenApiInfo"/> instance.
|
||||
/// </summary>
|
||||
public virtual OpenApiInfo OpenApiInfo { get; private set; }
|
||||
|
||||
private void SetProjectPath(string path)
|
||||
{
|
||||
if (path.IsNullOrWhiteSpace() || path == ".")
|
||||
{
|
||||
this._projectPath = Environment.CurrentDirectory.TrimEnd(directorySeparator);
|
||||
|
||||
var filepath = Directory.GetFiles(this._projectPath, "*.csproj").SingleOrDefault();
|
||||
if (filepath.IsNullOrWhiteSpace())
|
||||
{
|
||||
throw new FileNotFoundException();
|
||||
}
|
||||
|
||||
var csproj = new FileInfo(filepath);
|
||||
this._filename = csproj.Name;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var fqpath = System.IO.Path.IsPathFullyQualified(path)
|
||||
? path
|
||||
: $"{Environment.CurrentDirectory.TrimEnd(directorySeparator)}{directorySeparator}{path}";
|
||||
|
||||
if (fqpath.EndsWith(".csproj"))
|
||||
{
|
||||
var csproj = new FileInfo(fqpath);
|
||||
|
||||
this._projectPath = csproj.DirectoryName.TrimEnd(directorySeparator);
|
||||
this._filename = csproj.Name;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var di = new DirectoryInfo(fqpath);
|
||||
this._projectPath = di.FullName.TrimEnd(directorySeparator);
|
||||
|
||||
var segments = di.FullName.Split(new[] { directorySeparator }, StringSplitOptions.RemoveEmptyEntries);
|
||||
this._filename = $"{segments.Last()}.csproj";
|
||||
}
|
||||
|
||||
private void SetHostSettings()
|
||||
{
|
||||
this.HostJsonPath.ThrowIfNullOrWhiteSpace();
|
||||
|
||||
var host = new ConfigurationBuilder()
|
||||
.SetBasePath(this.HostJsonPath.Replace("host.json", ""))
|
||||
.AddJsonFile("host.json")
|
||||
.Build();
|
||||
|
||||
this.HostSettings = host;
|
||||
|
||||
var version = this.HostSettings.GetSection("version").Value;
|
||||
this.HostJsonHttpSettings = string.IsNullOrWhiteSpace(version)
|
||||
? host.Get<HttpSettings>("http")
|
||||
: (version.Equals("2.0", StringComparison.CurrentCultureIgnoreCase)
|
||||
? host.Get<HttpSettings>("extensions:http")
|
||||
: host.Get<HttpSettings>("http"));
|
||||
}
|
||||
|
||||
private void SetOpenApiInfo()
|
||||
{
|
||||
var assembly = Assembly.LoadFrom(this.CompiledDllPath);
|
||||
|
||||
var type = assembly.GetLoadableTypes()
|
||||
.SingleOrDefault(p => p.GetInterface("IOpenApiConfigurationOptions", ignoreCase: true).IsNullOrDefault() == false);
|
||||
if (type.IsNullOrDefault())
|
||||
{
|
||||
var settings = new DefaultOpenApiConfigurationOptions();
|
||||
this.OpenApiInfo = settings.Info;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var options = Activator.CreateInstance(type);
|
||||
|
||||
this.OpenApiInfo = (options as IOpenApiConfigurationOptions).Info;
|
||||
}
|
||||
|
||||
private bool IsValidOpenApiInfo(OpenApiInfo openApiInfo)
|
||||
{
|
||||
openApiInfo.ThrowIfNullOrDefault();
|
||||
|
||||
return !openApiInfo.IsNullOrDefault() && !openApiInfo.Version.IsNullOrDefault() && !openApiInfo.Title.IsNullOrWhiteSpace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const readMeSrc = path.resolve(__dirname, '..', '..', '..', '..', 'docs', 'openapi-cli.md');
|
||||
const readMeDest = path.resolve(__dirname, '..', 'README.md');
|
||||
|
||||
fs.copyFile(readMeSrc, readMeDest, (err) => {
|
||||
if (err) throw err;
|
||||
console.log('Copied openapi-cli.md from the docs directory.');
|
||||
});
|
|
@ -1,82 +0,0 @@
|
|||
#! /usr/bin/env node
|
||||
|
||||
const unzipper = require('unzipper');
|
||||
const url = require('url');
|
||||
const HttpsProxyAgent = require('https-proxy-agent');
|
||||
const https = require('https');
|
||||
const version = require('../package.json').version;
|
||||
const chalk = require('chalk');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const rimraf = require('rimraf');
|
||||
const glob = require('glob');
|
||||
const execSync = require('child_process').execSync;
|
||||
const ProgressBar = require('progress');
|
||||
const os = require('os');
|
||||
const args = process.argv;
|
||||
|
||||
function getPath() {
|
||||
const bin = path.resolve(path.join(path.dirname(__filename), '..', 'bin'));
|
||||
if (fs.existsSync(bin)) {
|
||||
rimraf.sync(bin);
|
||||
}
|
||||
return bin
|
||||
}
|
||||
|
||||
let platform = '';
|
||||
|
||||
if (os.platform() === 'win32') {
|
||||
platform = 'win-x64';
|
||||
} else if (os.platform() === 'darwin') {
|
||||
platform = 'osx-x64';
|
||||
} else if (os.platform() === 'linux') {
|
||||
platform = 'linux-x64';
|
||||
} else {
|
||||
throw Error('platform ' + os.platform() + ' isn\'t supported');
|
||||
}
|
||||
|
||||
const endpoint = 'https://functionscdn.azureedge.net/public/' + version + '/Azure.Functions.Cli.' + platform + '.' + version + '.zip';
|
||||
console.log('attempting to GET %j', endpoint);
|
||||
const options = url.parse(endpoint);
|
||||
// npm config preceed system environment
|
||||
// https://github.com/npm/npm/blob/19397ad523434656af3d3765e80e22d7e6305f48/lib/config/reg-client.js#L7-L8
|
||||
// https://github.com/request/request/blob/b12a6245d9acdb1e13c6486d427801e123fdafae/lib/getProxyFromURI.js#L66-L71
|
||||
const proxy = process.env.npm_config_https_proxy ||
|
||||
process.env.npm_config_proxy ||
|
||||
process.env.HTTPS_PROXY ||
|
||||
process.env.https_proxy ||
|
||||
process.env.HTTP_PROXY ||
|
||||
process.env.http_proxy;
|
||||
|
||||
if (proxy) {
|
||||
console.log('using proxy server %j', proxy);
|
||||
options.agent = new HttpsProxyAgent(proxy);
|
||||
}
|
||||
|
||||
https.get(options, response => {
|
||||
|
||||
const bar = new ProgressBar('[:bar] Downloading Azure Functions Core Tools', {
|
||||
total: Number(response.headers['content-length']),
|
||||
width: 18
|
||||
});
|
||||
|
||||
if (response.statusCode === 200) {
|
||||
const installPath = getPath();
|
||||
response.on('data', data => bar.tick(data.length));
|
||||
const unzipStream = unzipper.Extract({ path: installPath })
|
||||
.on('close', () => {
|
||||
if (os.platform() === 'linux' || os.platform() === 'darwin') {
|
||||
fs.chmodSync(`${installPath}/azfuncopenapi`, 0o755);
|
||||
}
|
||||
});
|
||||
response.pipe(unzipStream);
|
||||
} else {
|
||||
console.error(chalk.red('Error downloading zip file from ' + endpoint));
|
||||
console.error(chalk.red('Expected: 200, Actual: ' + response.statusCode));
|
||||
process.exit(1);
|
||||
}
|
||||
})
|
||||
.on('error', err => {
|
||||
console.error(chalk.red(err));
|
||||
process.exit(1);
|
||||
});
|
|
@ -1,21 +0,0 @@
|
|||
#! /usr/bin/env node
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const spawn = require('child_process').spawn;
|
||||
const fork = require('child_process').fork;
|
||||
const commandExists = require('command-exists');
|
||||
const args = process.argv;
|
||||
|
||||
function main() {
|
||||
const bin = path.resolve(path.join(path.dirname(__filename), '..', 'bin'));
|
||||
const funcProc = spawn(bin + '/azfuncopenapi', args.slice(2), {
|
||||
stdio: [process.stdin, process.stdout, process.stderr, 'pipe']
|
||||
});
|
||||
|
||||
funcProc.on('exit', code => {
|
||||
process.exit(code);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"name": "azure-functions-openapi-tools",
|
||||
"version": "0.8.0",
|
||||
"description": "This handles OpenAPI documents from Azure Functions without having to run the function app",
|
||||
"author": "Aliencube Community",
|
||||
"license": "MIT",
|
||||
"preferGlobal": true,
|
||||
"keywords": [
|
||||
"azure-functions",
|
||||
"cli",
|
||||
"openapi",
|
||||
"swagger"
|
||||
],
|
||||
"homepage": "https://github.com/aliencube/AzureFunctions.Extensions",
|
||||
"bugs": {
|
||||
"url": "https://github.com/aliencube/AzureFunctions.Extensions/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aliencube/AzureFunctions.Extensions.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node lib/install.js",
|
||||
"prepublishOnly": "node lib/copy-metadata.js"
|
||||
},
|
||||
"bin": {
|
||||
"azfuncopenapi": "lib/main.js"
|
||||
},
|
||||
"os": [
|
||||
"win32",
|
||||
"darwin",
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "3.0.0",
|
||||
"command-exists": "1.2.8",
|
||||
"glob": "7.1.6",
|
||||
"https-proxy-agent": "5.0.0",
|
||||
"progress": "2.0.3",
|
||||
"rimraf": "3.0.2",
|
||||
"tmp": "0.1.0",
|
||||
"unzipper": "0.10.10"
|
||||
}
|
||||
}
|
|
@ -17,25 +17,17 @@
|
|||
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.OpenApi</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|netcoreapp2.1'">
|
||||
<DocumentationFile>bin\Debug\netcoreapp2.1\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<DocumentationFile>bin\Debug\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Debug|netcoreapp3.1'">
|
||||
<DocumentationFile>bin\Debug\netcoreapp3.1\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|netcoreapp2.1'">
|
||||
<DocumentationFile>bin\Release\netcoreapp2.1\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)'=='Release|netcoreapp3.1'">
|
||||
<DocumentationFile>bin\Release\netcoreapp3.1\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DocumentationFile>bin\Release\netstandard2.0\Microsoft.Azure.WebJobs.Extensions.OpenApi.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Azure.WebJobs.Script.Abstractions" Version="1.0.0-preview" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
<PackageReference Include="YamlDotNet" Version="12.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -10,19 +10,19 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Microsoft.OpenApi" Version="1.2.3" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.2" />
|
||||
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net7.0</TargetFrameworks>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
|
@ -10,19 +10,19 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.3" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
|
@ -10,20 +10,20 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.3" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- <ItemGroup Condition="'$(TargetFramework)'=='netcoreapp2.1'">
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<AssemblyName>Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests</AssemblyName>
|
||||
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI\Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -1,25 +0,0 @@
|
|||
using System;
|
||||
|
||||
using FluentAssertions;
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Microsoft.Azure.WebJobs.Extensions.OpenApi.CLI.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class ProjectInfoTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void Given_Null_Parameters_When_Instantiated_Then_It_Should_Throw_Exception()
|
||||
{
|
||||
Action action = () => new ProjectInfo(null, null, null);
|
||||
action.Should().Throw<ArgumentNullException>();
|
||||
|
||||
action = () => new ProjectInfo("abc", null, null);
|
||||
action.Should().Throw<ArgumentNullException>();
|
||||
|
||||
action = () => new ProjectInfo("abc", "abc", null);
|
||||
action.Should().Throw<ArgumentNullException>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
|
@ -10,20 +10,20 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.3" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
|
@ -10,19 +10,19 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.7.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.18.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.8.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.3" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.0.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче