Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surgicalcoder/ApiClientGenerator
.net 6.0 Web Api Strongly Typed Client Generator
https://github.com/surgicalcoder/ApiClientGenerator
Last synced: about 1 month ago
JSON representation
.net 6.0 Web Api Strongly Typed Client Generator
- Host: GitHub
- URL: https://github.com/surgicalcoder/ApiClientGenerator
- Owner: surgicalcoder
- License: mit
- Created: 2021-12-12T16:40:41.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T22:29:12.000Z (11 months ago)
- Last Synced: 2024-03-26T06:03:22.323Z (9 months ago)
- Language: C#
- Size: 229 KB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - ApiClientGenerator
- csharp-source-generators - ApiClientGenerator - ![stars](https://img.shields.io/github/stars/surgicalcoder/ApiClientGenerator?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/surgicalcoder/ApiClientGenerator?style=flat-square&cacheSeconds=86400) Generates a strongly typed HttpClient based off MVC's default routing. Can be used to output into multiple projects, like Blazor WebAssembly. (Source Generators / Webprogramming)
README
# ApiClientGenerator
A .NET 6.0 Strongly typed HttpApi Client Generator, mainly being used on a Blazor WebAssembly project. With this project, you can easily and quickly generate a strongly typed HttpClient, with some trimmings, and have it placed in your Blazor WebAssembly project.# How to use
Firstly, add the project from Nuget - [GoLive.Generator.ApiClientGenerator](https://www.nuget.org/packages/GoLive.Generator.ApiClientGenerator/), then add an AdditionalFile in your .csproj named "ApiClientGenerator.json", like so:
```
```
Once that's done, add the settings file and change as required:
```
{
"OutputFile": "GeneratedApiClient.cs",
"Namespace": "GoLive.Generator.ApiClientGenerator.Tests.WebApi.Generated",
"CustomDiscriminator": "CustomDiscriminatorCreate()",
"Includes": [
"GoLive.Generator.ApiClientGenerator"
],
"PreAppendLines": [
"// ReSharper disable All"
],
"PostAppendLines": [
"// ReSharper disable All"
]
}
```For `OutputFile` (or `OutputFiles` if you want multiple), the path will be calculated as relative, so you can put in `..\WebAssembly\File.cs`