OpenApiGenerator.Cli
0.4.0
See the version list below for details.
dotnet tool install --global OpenApiGenerator.Cli --version 0.4.0
dotnet new tool-manifest
dotnet tool install --local OpenApiGenerator.Cli --version 0.4.0
#tool dotnet:?package=OpenApiGenerator.Cli&version=0.4.0
nuke :add-package OpenApiGenerator.Cli --version 0.4.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.
| 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. |
This package has no dependencies.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 0.22.6-dev.7 | 1,633 | 9/9/2024 | |
| 0.22.6-dev.6 | 111 | 9/9/2024 | |
| 0.22.6-dev.4 | 294 | 9/7/2024 | |
| 0.22.6-dev.2 | 152 | 9/7/2024 | |
| 0.22.6-dev.1 | 130 | 9/7/2024 | |
| 0.22.5 | 314 | 9/7/2024 | |
| 0.22.4 | 200 | 9/7/2024 | |
| 0.22.3 | 198 | 9/7/2024 | |
| 0.22.2 | 213 | 9/7/2024 | |
| 0.22.1 | 222 | 9/7/2024 | |
| 0.22.0 | 199 | 9/7/2024 | |
| 0.21.1 | 267 | 9/6/2024 | |
| 0.21.0 | 214 | 9/6/2024 | |
| 0.20.2 | 834 | 8/31/2024 | |
| 0.20.1 | 186 | 8/31/2024 | |
| 0.20.0 | 221 | 8/30/2024 | |
| 0.19.0 | 205 | 8/30/2024 | |
| 0.18.0 | 299 | 8/29/2024 | |
| 0.17.1 | 226 | 8/28/2024 | |
| 0.17.0 | 211 | 8/28/2024 | |
| 0.16.4-dev.7 | 135 | 8/28/2024 | |
| 0.16.3 | 568 | 8/24/2024 | |
| 0.16.2 | 235 | 8/24/2024 | |
| 0.16.1 | 313 | 8/23/2024 | |
| 0.16.0 | 279 | 8/22/2024 | |
| 0.15.8 | 236 | 8/22/2024 | |
| 0.15.7 | 359 | 8/19/2024 | |
| 0.15.6 | 280 | 8/18/2024 | |
| 0.15.5 | 195 | 8/18/2024 | |
| 0.15.4 | 345 | 8/15/2024 | |
| 0.15.3 | 286 | 8/13/2024 | |
| 0.15.2 | 261 | 8/13/2024 | |
| 0.15.1 | 237 | 8/12/2024 | |
| 0.15.0 | 243 | 8/11/2024 | |
| 0.14.3 | 373 | 8/6/2024 | |
| 0.14.2 | 197 | 8/5/2024 | |
| 0.14.1 | 166 | 8/5/2024 | |
| 0.14.0 | 175 | 8/5/2024 | |
| 0.13.11 | 488 | 7/22/2024 | |
| 0.13.10 | 234 | 7/21/2024 | |
| 0.13.9 | 229 | 7/18/2024 | |
| 0.13.8 | 216 | 7/15/2024 | |
| 0.13.7 | 191 | 7/15/2024 | |
| 0.13.6 | 187 | 7/14/2024 | |
| 0.13.5 | 200 | 7/14/2024 | |
| 0.13.4 | 214 | 7/13/2024 | |
| 0.13.3 | 219 | 7/9/2024 | |
| 0.13.2 | 187 | 7/8/2024 | |
| 0.13.1 | 202 | 7/8/2024 | |
| 0.13.0 | 216 | 7/8/2024 | |
| 0.12.2 | 211 | 7/8/2024 | |
| 0.12.1 | 211 | 7/6/2024 | |
| 0.12.0 | 213 | 7/6/2024 | |
| 0.11.11 | 217 | 7/6/2024 | |
| 0.11.10 | 192 | 7/6/2024 | |
| 0.11.9 | 209 | 6/30/2024 | |
| 0.11.8 | 232 | 6/30/2024 | |
| 0.11.7 | 225 | 6/30/2024 | |
| 0.11.6 | 220 | 6/29/2024 | |
| 0.11.4 | 206 | 6/27/2024 | |
| 0.11.3 | 237 | 6/27/2024 | |
| 0.11.1 | 179 | 6/20/2024 | |
| 0.11.0 | 222 | 6/16/2024 | |
| 0.10.8 | 222 | 6/15/2024 | |
| 0.10.7 | 196 | 6/15/2024 | |
| 0.10.6 | 209 | 6/15/2024 | |
| 0.10.4 | 213 | 6/13/2024 | |
| 0.10.2 | 201 | 6/13/2024 | |
| 0.10.1 | 213 | 6/13/2024 | |
| 0.10.0 | 197 | 6/13/2024 | |
| 0.9.12 | 200 | 6/6/2024 | |
| 0.9.11 | 195 | 6/6/2024 | |
| 0.9.10 | 209 | 6/5/2024 | |
| 0.9.9 | 215 | 6/5/2024 | |
| 0.9.8 | 231 | 6/4/2024 | |
| 0.9.7 | 220 | 6/1/2024 | |
| 0.9.5 | 221 | 5/31/2024 | |
| 0.9.4 | 214 | 5/31/2024 | |
| 0.9.3 | 215 | 5/31/2024 | |
| 0.9.1 | 215 | 5/30/2024 | |
| 0.9.0 | 215 | 5/30/2024 | |
| 0.8.8 | 226 | 5/28/2024 | |
| 0.8.6 | 215 | 5/27/2024 | |
| 0.8.5 | 203 | 5/27/2024 | |
| 0.8.4 | 216 | 5/27/2024 | |
| 0.8.3 | 224 | 5/27/2024 | |
| 0.8.1 | 225 | 5/25/2024 | |
| 0.8.0 | 207 | 5/25/2024 | |
| 0.7.2 | 225 | 5/23/2024 | |
| 0.7.1 | 229 | 5/22/2024 | |
| 0.7.0 | 234 | 5/22/2024 | |
| 0.6.9 | 214 | 5/22/2024 | |
| 0.6.8 | 222 | 5/21/2024 | |
| 0.6.7 | 208 | 5/21/2024 | |
| 0.6.6 | 218 | 5/19/2024 | |
| 0.6.5 | 217 | 5/19/2024 | |
| 0.6.4 | 226 | 5/19/2024 | |
| 0.6.3 | 202 | 5/19/2024 | |
| 0.6.2 | 194 | 5/19/2024 | |
| 0.6.1 | 199 | 5/19/2024 | |
| 0.6.0 | 207 | 5/19/2024 | |
| 0.5.0 | 221 | 5/19/2024 | |
| 0.4.0 | 215 | 5/19/2024 | |
| 0.3.2 | 195 | 5/13/2024 | |
| 0.3.1 | 194 | 5/13/2024 | |
| 0.3.0 | 189 | 5/13/2024 | |
| 0.2.0 | 186 | 5/11/2024 |
⭐ Last 10 features:
- 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
- feat: Added initial support of OpenAI OpenAPI spec. 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