OpenApiGenerator.Core
0.5.0
See the version list below for details.
dotnet add package OpenApiGenerator.Core --version 0.5.0
NuGet\Install-Package OpenApiGenerator.Core -Version 0.5.0
<PackageReference Include="OpenApiGenerator.Core" Version="0.5.0" />
paket add OpenApiGenerator.Core --version 0.5.0
#r "nuget: OpenApiGenerator.Core, 0.5.0"
// Install OpenApiGenerator.Core as a Cake Addin
#addin nuget:?package=OpenApiGenerator.Core&version=0.5.0
// Install OpenApiGenerator.Core as a Cake Tool
#tool nuget:?package=OpenApiGenerator.Core&version=0.5.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 optional settings to your csproj file to customize generation. 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_GenerateSdk>false</OpenApiGenerator_GenerateSdk>
<OpenApiGenerator_GenerateModels>true</OpenApiGenerator_GenerateModels>
<OpenApiGenerator_GenerateMethods>true</OpenApiGenerator_GenerateMethods>
<OpenApiGenerator_GenerateConstructors>true</OpenApiGenerator_GenerateConstructors>
<OpenApiGenerator_IncludeOperationIds>getPet;deletePet</OpenApiGenerator_IncludeOperationIds>
<OpenApiGenerator_ExcludeOperationIds>getPet;deletePet</OpenApiGenerator_ExcludeOperationIds>
<OpenApiGenerator_IncludeModels>Pet;Model</OpenApiGenerator_IncludeModels>
<OpenApiGenerator_ExcludeModels>Pet;Model</OpenApiGenerator_ExcludeModels>
</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.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.OpenApi.Readers (>= 1.6.14)
- System.Collections.Immutable (>= 8.0.0)
-
.NETStandard 2.0
- Microsoft.OpenApi.Readers (>= 1.6.14)
- System.Collections.Immutable (>= 8.0.0)
-
net6.0
- Microsoft.OpenApi.Readers (>= 1.6.14)
- System.Collections.Immutable (>= 8.0.0)
-
net8.0
- Microsoft.OpenApi.Readers (>= 1.6.14)
- System.Collections.Immutable (>= 8.0.0)
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.9 | 18 | 6/30/2024 |
0.11.8 | 17 | 6/30/2024 |
0.11.7 | 19 | 6/30/2024 |
0.11.6 | 38 | 6/29/2024 |
0.11.4 | 34 | 6/27/2024 |
0.11.3 | 42 | 6/27/2024 |
0.11.1 | 66 | 6/20/2024 |
0.11.0 | 76 | 6/16/2024 |
0.10.8 | 73 | 6/15/2024 |
0.10.7 | 76 | 6/15/2024 |
0.10.6 | 68 | 6/15/2024 |
0.10.4 | 67 | 6/13/2024 |
0.10.2 | 65 | 6/13/2024 |
0.10.1 | 61 | 6/13/2024 |
0.10.0 | 64 | 6/13/2024 |
0.9.12 | 71 | 6/6/2024 |
0.9.11 | 62 | 6/6/2024 |
0.9.10 | 69 | 6/5/2024 |
0.9.9 | 65 | 6/5/2024 |
0.9.8 | 68 | 6/4/2024 |
0.9.7 | 77 | 6/1/2024 |
0.9.5 | 83 | 5/31/2024 |
0.9.4 | 80 | 5/31/2024 |
0.9.3 | 74 | 5/31/2024 |
0.9.1 | 77 | 5/30/2024 |
0.9.0 | 73 | 5/30/2024 |
0.8.8 | 73 | 5/28/2024 |
0.8.6 | 70 | 5/27/2024 |
0.8.5 | 70 | 5/27/2024 |
0.8.4 | 72 | 5/27/2024 |
0.8.3 | 70 | 5/27/2024 |
0.8.1 | 95 | 5/25/2024 |
0.8.0 | 73 | 5/25/2024 |
0.7.2 | 85 | 5/23/2024 |
0.7.1 | 84 | 5/22/2024 |
0.7.0 | 77 | 5/22/2024 |
0.6.9 | 74 | 5/22/2024 |
0.6.8 | 73 | 5/21/2024 |
0.6.7 | 81 | 5/21/2024 |
0.6.6 | 77 | 5/19/2024 |
0.6.5 | 72 | 5/19/2024 |
0.6.4 | 73 | 5/19/2024 |
0.6.3 | 74 | 5/19/2024 |
0.6.2 | 77 | 5/19/2024 |
0.6.1 | 74 | 5/19/2024 |
0.6.0 | 72 | 5/19/2024 |
0.5.0 | 82 | 5/19/2024 |
0.4.0 | 81 | 5/19/2024 |
0.3.2 | 81 | 5/13/2024 |
0.3.1 | 73 | 5/13/2024 |
0.3.0 | 71 | 5/13/2024 |
0.2.0 | 81 | 5/11/2024 |
0.1.5 | 83 | 5/10/2024 |
0.1.4 | 80 | 5/10/2024 |
0.1.3 | 101 | 4/5/2024 |
⭐ Last 10 features:
- feat: Added trimming support. 2024-05-19
- feat: Now it generates full sdk by default. 2024-05-19
- feat: Added enum support for query/path parameters. 2024-05-19
- feat: Added generation of models from parameters. 2024-05-19
- feat: Added ability to serialize different types of parameters. 2024-05-19
- feat: Added initial support of query parameters. 2024-05-18
- feat: Added path parameters support. 2024-05-17
- feat: Updated OpenAI OpenAPI spec. 2024-05-13
- feat: Added parse diagnostic exceptions. 2024-05-13
- feat: Added support to compute operationId. 2024-05-13
🐞 Last 10 bug fixes:
- fix: Fixed GetCSharpType parents Last() calls. 2024-05-17
- fix: Fixed issue with array of child items of same type. 2024-05-17
- fix: Fixed issue with {} as default value. 2024-05-17
- fix: Try to fix tabs. 2024-05-13
- fix: Fixed Environment.NewLine. 2024-05-13
- fix: Initial support for OpenAI methods generation. 2024-05-13
- fix: Fixed [] in property name. 2024-05-13
- fix: Fixed issue with default value for array. 2024-05-13
- fix: Fixed enums with []. 2024-05-13
- fix: Fixed some other bugs with default values. 2024-05-13