OpenApiGenerator 0.3.0
See the version list below for details.
dotnet add package OpenApiGenerator --version 0.3.0
NuGet\Install-Package OpenApiGenerator -Version 0.3.0
<PackageReference Include="OpenApiGenerator" Version="0.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
paket add OpenApiGenerator --version 0.3.0
#r "nuget: OpenApiGenerator, 0.3.0"
// Install OpenApiGenerator as a Cake Addin
#addin nuget:?package=OpenApiGenerator&version=0.3.0
// Install OpenApiGenerator as a Cake Tool
#tool nuget:?package=OpenApiGenerator&version=0.3.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:
CLI
You can use the CLI to generate the code.
dotnet tool install --global openapigenerator.cli --prerelease
oag --help
oag generate openapi.yaml
It will generate the code in the "openapi" subdirectory.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.11.0 | 73 | 6/16/2024 |
0.10.8 | 66 | 6/15/2024 |
0.10.7 | 64 | 6/15/2024 |
0.10.6 | 58 | 6/15/2024 |
0.10.4 | 59 | 6/13/2024 |
0.10.2 | 55 | 6/13/2024 |
0.10.1 | 53 | 6/13/2024 |
0.10.0 | 58 | 6/13/2024 |
0.9.12 | 85 | 6/6/2024 |
0.9.11 | 60 | 6/6/2024 |
0.9.10 | 71 | 6/5/2024 |
0.9.9 | 70 | 6/5/2024 |
0.9.8 | 62 | 6/4/2024 |
0.9.7 | 82 | 6/1/2024 |
0.9.5 | 76 | 5/31/2024 |
0.9.4 | 69 | 5/31/2024 |
0.9.3 | 71 | 5/31/2024 |
0.9.1 | 72 | 5/30/2024 |
0.9.0 | 67 | 5/30/2024 |
0.8.8 | 64 | 5/28/2024 |
0.8.6 | 73 | 5/27/2024 |
0.8.5 | 66 | 5/27/2024 |
0.8.4 | 67 | 5/27/2024 |
0.8.3 | 69 | 5/27/2024 |
0.8.1 | 76 | 5/25/2024 |
0.8.0 | 68 | 5/25/2024 |
0.7.2 | 71 | 5/23/2024 |
0.7.1 | 74 | 5/22/2024 |
0.7.0 | 69 | 5/22/2024 |
0.6.9 | 69 | 5/22/2024 |
0.6.8 | 70 | 5/21/2024 |
0.6.7 | 70 | 5/21/2024 |
0.6.6 | 86 | 5/19/2024 |
0.6.5 | 67 | 5/19/2024 |
0.6.4 | 65 | 5/19/2024 |
0.6.3 | 67 | 5/19/2024 |
0.6.2 | 65 | 5/19/2024 |
0.6.1 | 65 | 5/19/2024 |
0.6.0 | 67 | 5/19/2024 |
0.5.0 | 72 | 5/19/2024 |
0.4.0 | 79 | 5/19/2024 |
0.3.2 | 75 | 5/13/2024 |
0.3.1 | 80 | 5/13/2024 |
0.3.0 | 67 | 5/13/2024 |
0.2.0 | 74 | 5/11/2024 |
0.1.5 | 71 | 5/10/2024 |
0.1.4 | 70 | 5/10/2024 |
0.1.3 | 295 | 1/8/2024 |
0.1.2 | 161 | 1/8/2024 |
0.1.1 | 128 | 1/8/2024 |
0.1.0-dev.37 | 61 | 1/8/2024 |
0.1.0-dev.35 | 60 | 1/8/2024 |
0.1.0-dev.34 | 49 | 1/8/2024 |
0.1.0-dev.33 | 53 | 1/7/2024 |
0.1.0-dev.10 | 111 | 12/6/2023 |
0.1.0-dev.5 | 63 | 12/4/2023 |
0.1.0-dev.4 | 63 | 11/27/2023 |
0.1.0-dev.3 | 54 | 11/25/2023 |
⭐ Last 10 features:
- feat: Added Streaming support. 2024-05-13
- feat: Added support for other HttpMethod types. 2024-05-13
- feat: Added support for generation of Get methods. 2024-05-13
- feat: Added GenerateConstructors/GenerateMethods settings. 2024-05-13
- 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
🐞 Last 10 bug fixes:
- fix: Fixed missing EquatableArray. 2024-05-13
- 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