File tree 3 files changed +20
-13
lines changed
src/AzureOpenAIProxy.ApiApp
3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 49
49
run : |
50
50
dotnet new tool-manifest
51
51
dotnet tool install SwashBuckle.AspNetCore.Cli
52
+
53
+ - name : Install Spectral Cli
54
+ shell : bash
55
+ run : |
56
+ curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sh
52
57
53
58
- name : Restore NuGet packages
54
59
shell : bash
61
66
dotnet build
62
67
63
68
- name : OpenAPI linting
64
- uses : stoplightio/spectral-action@latest
65
- with :
66
- file_glob : ' ./src/AzureOpenAIProxy.ApiApp/openapi.json'
69
+ shell : bash
70
+ run : |
71
+ API_VERSION=$(grep -oP 'public const string Version = "\K[^"]+' ./src/AzureOpenAIProxy.ApiApp/Constants.cs)
72
+ dotnet swagger tofile --output ./openapi.json ./src/AzureOpenAIProxy.ApiApp/bin/Debug/net8.0/AzureOpenAIProxy.ApiApp.dll $API_VERSION
73
+ spectral lint openapi.json
67
74
68
75
- name : Run unit tests
69
76
shell : bash
Original file line number Diff line number Diff line change 63
63
run : |
64
64
dotnet new tool-manifest
65
65
dotnet tool install SwashBuckle.AspNetCore.Cli
66
+
67
+ - name : Install Spectral Cli
68
+ shell : bash
69
+ run : |
70
+ curl -L https://raw.github.com/stoplightio/spectral/master/scripts/install.sh | sh
66
71
67
72
- name : Restore NuGet packages
68
73
shell : bash
75
80
dotnet build
76
81
77
82
- name : OpenAPI linting
78
- uses : stoplightio/spectral-action@latest
79
- with :
80
- file_glob : ' ./src/AzureOpenAIProxy.ApiApp/openapi.json'
83
+ shell : bash
84
+ run : |
85
+ API_VERSION=$(grep -oP 'public const string Version = "\K[^"]+' ./src/AzureOpenAIProxy.ApiApp/Constants.cs)
86
+ dotnet swagger tofile --output ./openapi.json ./src/AzureOpenAIProxy.ApiApp/bin/Debug/net8.0/AzureOpenAIProxy.ApiApp.dll $API_VERSION
87
+ spectral lint openapi.json
81
88
82
89
- name : Test solution
83
90
shell : bash
Original file line number Diff line number Diff line change 5
5
<Nullable >enable</Nullable >
6
6
<ImplicitUsings >enable</ImplicitUsings >
7
7
8
- <!-- This should be the same value as the API version in Constant.cs -->
9
- <ApiVersion >v1.0.0</ApiVersion >
10
-
11
8
<AssemblyName >AzureOpenAIProxy.ApiApp</AssemblyName >
12
9
<RootNamespace >AzureOpenAIProxy.ApiApp</RootNamespace >
13
10
</PropertyGroup >
24
21
<ProjectReference Include =" ..\AzureOpenAIProxy.ServiceDefaults\AzureOpenAIProxy.ServiceDefaults.csproj" />
25
22
</ItemGroup >
26
23
27
- <Target Name =" CreateSwaggerJson" AfterTargets =" Build" Condition =" $(Configuration)=='Debug'" >
28
- <Exec Command =" dotnet swagger tofile --output ./openapi.json $(OutputPath)$(AssemblyName).dll $(ApiVersion)" WorkingDirectory =" $(ProjectDir)" />
29
- </Target >
30
-
31
24
</Project >
You can’t perform that action at this time.
0 commit comments