Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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`