OpenApiGenerator.Cli 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global OpenApiGenerator.Cli --version 0.2.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local OpenApiGenerator.Cli --version 0.2.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=OpenApiGenerator.Cli&version=0.2.0
nuke :add-package OpenApiGenerator.Cli --version 0.2.0

OpenApiGenerator

Allows you to partially (for example, only models) or completely generate a native (without dependencies) C# client sdk according to the OpenAPI specification.
Inspired by NSwag

🔥Features🔥

  • Uses Incremental Source Generators for efficient generation and caching.
  • Detects your TargetFramework and generates optimal code for it (including net6.0/net7.0/net8.0 improvements)
  • Supports .Net Framework/.Net Standard
  • Does not contain dependencies for modern versions of dotnet
  • Only System.Text.Json dependency for .Net Framework/.Net Standard
  • Any generated methods provide the ability to pass a CancellationToken
  • Allows partial generation (models only) or end points filtering
  • Available under MIT license for general users and most organizations
  • Uses https://github.com/microsoft/OpenAPI.NET for parsing OpenAPI specification
  • Supports trimming/native AOT compilation

🚀Quick start🚀

  • Install the package
dotnet add package OpenApiGenerator
  • Add the following to your csproj file. You can check all settings here:


<ItemGroup Label="OpenApiGenerator">
    <AdditionalFiles Include="$(MSBuildThisFileDirectory)../../../docs/openapi.yaml" />
</ItemGroup>

<PropertyGroup Label="OpenApiGenerator">
    <OpenApiGenerator_Namespace>Ollama</OpenApiGenerator_Namespace>
    <OpenApiGenerator_ClassName>OllamaApi</OpenApiGenerator_ClassName>
    <OpenApiGenerator_GenerateModels>true</OpenApiGenerator_GenerateModels>
    <OpenApiGenerator_GenerateSdk>false</OpenApiGenerator_GenerateSdk>
</PropertyGroup>
  • It's all! Now you can build your project and use the generated code. You also can use IDE to see the generated code in any moment, this is a example for Rider:
    rider_show_generated_code.png
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.7.2 0 5/23/2024
0.7.1 31 5/22/2024
0.7.0 38 5/22/2024
0.6.9 34 5/22/2024
0.6.8 68 5/21/2024
0.6.7 72 5/21/2024
0.6.6 71 5/19/2024
0.6.5 67 5/19/2024
0.6.4 62 5/19/2024
0.6.3 65 5/19/2024
0.6.2 65 5/19/2024
0.6.1 64 5/19/2024
0.6.0 64 5/19/2024
0.5.0 71 5/19/2024
0.4.0 73 5/19/2024
0.3.2 64 5/13/2024
0.3.1 60 5/13/2024
0.3.0 55 5/13/2024
0.2.0 61 5/11/2024

⭐ Last 10 features:
- feat: Added Settings.UseRequiredKeyword. 2024-05-11
- feat: Added ability to use Newtonsoft.Json. 2024-05-11
- feat: Added CLI tool. 2024-05-11
- feat: Make Core lib multi-target. 2024-05-11
- feat: Added support for OpenAI.CreateModerationResponse. 2024-01-08
- feat: Added initial endpoints generation. 2024-01-08
- feat: New array is IList by default. 2023-12-22
- feat: Now NamingConvention.ConcatNames is default. 2023-12-22
- feat: Unified naming. 2023-12-22
- feat: Added NamingConvention. 2023-12-22
🐞 Last 10 bug fixes:
- fix: Moved CLI. 2024-05-11
- fix: Fixed issue <> in xml docs. 2024-05-10
- fix: Added missing xml doc for AdditionalProperties. 2024-05-10
- fix: Released. 2024-05-10
- fix: Fixed issue with enum names with whitespace separator. 2024-05-10
- fix: Try to do models public. 2024-01-08
- fix: Try to use IsExternalInit. 2024-01-08
- fix: Try fixed version. 2024-01-08
- fix: Update dll paths in OpenApiGenerator project 2024-01-08
- fix: Try to use fixed assemblies. 2024-01-08