-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added generation of strongly typed http client on build
- Removed project for manual generation of client - AnalogCore clients are now automatically generated on build
- Loading branch information
Showing
12 changed files
with
44 additions
and
7,099 deletions.
There are no files selected for viewing
2,513 changes: 0 additions & 2,513 deletions
2,513
Shifty.Api/Generated/AnalogCoreV1/AnalogCoreV1.cs
This file was deleted.
Oops, something went wrong.
4,446 changes: 0 additions & 4,446 deletions
4,446
Shifty.Api/Generated/AnalogCoreV2/AnalogCoreV2.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Auto generated strongly typed http client for Core Api | ||
This project only contains the configuration required to generate strongly typed http clients that we use to test the Api. The clients are outputted in /obj folder, whenever this project is build. | ||
|
||
This is set up by configuring the OpenApiReference to point to the versioned openApi specs of the Core Api committed in this repository . | ||
|
||
The clients that are out putted are: | ||
- AnalogCoreV1 | ||
- AnalogCoreV2 | ||
|
||
See the following for more info in how to set up, and configure clients | ||
- [Microsoft reference](https://learn.microsoft.com/en-us/aspnet/core/web-api/microsoft.dotnet-openapi?view=aspnetcore-8.0) | ||
- [Blog explaining in detail](https://stevetalkscode.co.uk/openapireference-commands) ([Backup archive.org](https://web.archive.org/web/20240415183726/https://stevetalkscode.co.uk/openapireference-commands)) |
30 changes: 30 additions & 0 deletions
30
Shifty.Generated.ApiClient/Shifty.Generated.ApiClient.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>10</LangVersion> | ||
<RootNamespace>Shifty.Api</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||
<PackageReference Include="NSwag.ApiDescription.Client" Version="14.0.7" /> | ||
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<OpenApiReference Include="OpenApiSpecs/AnalogCoreV1.json" > | ||
<ClassName>AnalogCoreV1</ClassName> | ||
<Namespace>Shifty.Api.Generated.AnalogCoreV1</Namespace> | ||
<Options>/UseBaseUrl:false /OperationGenerationMode:SingleClientFromPathSegments</Options> | ||
</OpenApiReference> | ||
<OpenApiReference Include="OpenApiSpecs/AnalogCoreV2.json" > | ||
<ClassName>AnalogCoreV2</ClassName> | ||
<Namespace>Shifty.Api.Generated.AnalogCoreV2</Namespace> | ||
<Options>/AdditionalNamespaceUsages:Shifty.Api.Generated.AnalogCoreV1 /UseBaseUrl:false /OperationGenerationMode:SingleClientFromPathSegments</Options> | ||
</OpenApiReference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters