File tree Expand file tree Collapse file tree 3 files changed +13
-10
lines changed
EcommerceDDD.ServiceClients Expand file tree Collapse file tree 3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1313 </PropertyGroup >
1414
1515 <ItemGroup >
16- <PackageReference Include =" Koalesce.OpenAPI" Version =" 1.0.0-alpha.3 " />
16+ <PackageReference Include =" Koalesce.OpenAPI" Version =" 1.0.0-alpha.4 " />
1717 <PackageReference Include =" Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version =" 1.22.1" />
1818 <PackageReference Include =" Ocelot" Version =" 24.1.0" />
1919 </ItemGroup >
Original file line number Diff line number Diff line change 2525 </None >
2626 </ItemGroup >
2727
28- <ItemGroup >
29- <Folder Include =" Kiota\" />
30- </ItemGroup >
31-
32- <!-- Only generate Kiota client during Debug builds -->
33- <Target Name =" GenerateKiotaClient" BeforeTargets =" Build" Condition =" '$(Configuration)' == 'Debug'" >
34- <Exec Command =" kiota generate -d ../../../src/Crosscutting/EcommerceDDD.ServiceClients/apigateway.yaml -l CSharp -c ApiGatewayClient -n EcommerceDDD.ServiceClients.ApiGateway -o Kiota" />
35- </Target >
28+ <!-- Only run during Debug builds -->
29+ <!-- Should generate merged definition if the microservices are up and running -->
30+ <Target Name =" GenerateSingleGatewayDefinition" BeforeTargets =" Build" Condition =" '$(Configuration)' == 'Debug'" >
31+ <Exec Command =" koalesce --config " $(MSBuildProjectDirectory)/../../../src/Crosscutting/EcommerceDDD.ApiGateway/appsettings.json" --output " $(MSBuildProjectDirectory)/../../../src/Crosscutting/EcommerceDDD.ServiceClients/apigateway.yaml" " />
32+ </Target >
33+
34+ <!-- Should generate Kiota client if having the apigateway.yaml in place from the previous step -->
35+ <Target Name =" GenerateKiotaClient" BeforeTargets =" Build" AfterTargets =" GenerateSingleGatewayDefinition" Condition =" '$(Configuration)' == 'Debug' AND Exists('$(MSBuildProjectDirectory)/../../../src/Crosscutting/EcommerceDDD.ServiceClients/apigateway.yaml')" >
36+
37+ <Exec Command =" kiota generate -d " $(MSBuildProjectDirectory)/../../../src/Crosscutting/EcommerceDDD.ServiceClients/apigateway.yaml" -l CSharp -c ApiGatewayClient -n EcommerceDDD.ServiceClients.ApiGateway -o Kiota" />
38+ </Target >
3639</Project >
Original file line number Diff line number Diff line change 11## Generating API gateway single OpenAPI definition with Koalesce
22
33## Install Koalesce.OpenAPI.CLI
4- dotnet tool install --global Koalesce.OpenAPI.CLI --version 0.1.1 -alpha.1
4+ dotnet tool install --global Koalesce.OpenAPI.CLI --version 1.0.0 -alpha.4 (or latest)
55
66### Execute it while running the solution if you want to update this apigateway.yaml to generate new Kiota clients
77koalesce --config .your-path\EcommerceDDD\src\Crosscutting\EcommerceDDD.ApiGateway\appsettings.json --output .your-path\EcommerceDDD\src\Crosscutting\EcommerceDDD.ServiceClients\apigateway.yaml
You can’t perform that action at this time.
0 commit comments