DynamicApiClientGen 1.0.1
dotnet tool install --global DynamicApiClientGen --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local DynamicApiClientGen --version 1.0.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=DynamicApiClientGen&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package DynamicApiClientGen --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DynamicApiClientGen ๐
Generate fully-typed C# API clients from Swagger/OpenAPI definitions โ fast, automatic, and CLI-friendly.
๐ Features
- Parses Swagger/OpenAPI JSON
- Generates strongly-typed C# API client classes
- Supports HTTP methods:
GET
,POST
,PUT
,DELETE
- Integrates with
HttpClientFactory
- Simple CLI usage (install once, use anywhere)
- Usable as a .NET library in your own code
- Cross-platform
๐ Installation
๐ CLI Tool (Global)
dotnet tool install --global DynamicApiClientGen
๐ Core Library (NuGet)
dotnet add package DynamicApiClientGen.Core
๐งช Usage
โ CLI Tool (Command-Line)
From a local Swagger JSON file
DynamicApiClientGen --input ./swagger.json --output ./GeneratedApiClient.cs
From a remote Swagger URL
DynamicApiClientGen --input https://api.example.com/swagger/v1/swagger.json --output ./Client.cs
โ Core Library (Programmatic Usage in C#)
using DynamicApiClientGen.Core;
using System.Text.Json;
var swaggerJson = File.ReadAllText("swagger.json");
var swaggerDoc = SwaggerParser.ParseSwaggerJson(swaggerJson);
var generatedCode = ApiClientGenerator.GenerateApiClient(swaggerDoc);
File.WriteAllText("GeneratedClient.cs", generatedCode);
๐ License
This project is licensed under the MIT License. You are free to use, modify, distribute, and integrate it into personal or commercial projects.
๐ Repository
GitHub: github.com/alikeb1998/DynamicApiClientGen
โจ NuGet Packages
Project | Package Name | Installation Command |
---|---|---|
CLI Tool | DynamicApiClientGen |
dotnet tool install --global DynamicApiClientGen |
Core Library (C# usage) | DynamicApiClientGen.Core |
dotnet add package DynamicApiClientGen.Core |
๐ Contributing
Feel free to open issues or submit pull requests. Feedback and contributions are always welcome!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.