WebApiToOpenApiReflector 1.3.0

dotnet tool install --global WebApiToOpenApiReflector --version 1.3.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 WebApiToOpenApiReflector --version 1.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WebApiToOpenApiReflector&version=1.3.0
                    
nuke :add-package WebApiToOpenApiReflector --version 1.3.0
                    

NuGet Version

WebApiToOpenApiReflector

A dotnet tool that can use reflection to generate OpenApi from .NetFramework assemblies

Intent of this tool

This tool is to help with the recent removal of the webapi2openapi command from NSwag. This tool does not replace NSwag, but is a pre-processor utility to generate the swagger specifications using reflection on .NET Framework assemblies. This tool is not recommended for .NET Core assemblies, as the NSwag CLI already supports it.

Installation

dotnet tool install -g WebApiToOpenApiReflector

Usage

Usage: WebApiToOpenApiReflector [--controller-names <String>...] [--default-url-template <String>] [--add-missing-path-parameters] [--default-response-reference-type-null-handling <ReferenceTypeNullHandling>] [--generate-original-parameter-names=<true|false>] [--title <String>] [--description <String>] [--info-version <String>] [--document-template <String>] [--output <String>] [--help] [--version] assembly-paths0 ... assembly-pathsN

Generates a Swagger/OpenAPI specification for a controller or controllers contained in a .NET Web API assembly.

Arguments:
  0: assembly-paths    The assembly or assemblies to process. (Required)

Options:
  -c, --controller-names <String>...                                                 Can optionally be used to limit the results to some controllers.
  -u, --default-url-template <String>                                                The Web API default URL template: (default for Web API: 'api/{controller}/{id}'; (default for MVC: '{controller}/{action}/{id?}'). (Default: api/{controller}/{id})
  -a, --add-missing-path-parameters                                                  If true, adds missing path parameters which are missing in the action method.
  -n, --default-response-reference-type-null-handling <ReferenceTypeNullHandling>    Specifies the default null handling for reference types when no nullability information is available. NotNull (default) or Null. (Default: Null) (Allowed values: Null, NotNull)
  -g, --generate-original-parameter-names=<true|false>                               Generate x-originalName properties when parameter name is different in .NET and HTTP. (Default: True)
  -t, --title <String>                                                               Specifies the title of the Swagger specification, ignored when the document template is provided.
  -d, --description <String>                                                         Specifies the description of the Swagger specification, ignored when the document template is provided.
  -v, --info-version <String>                                                        Specifies the version of the Swagger specification (default: 1.0.0). (Default: 1.0.0)
  --document-template <String>                                                       Specifies the Swagger document template (may be a path or JSON, default: none).
  -o, --output <String>                                                              The path to the file to write the specifications to. (Default: swagger.json)
  -h, --help                                                                         Show help message
  --version                                                                          Show version
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.  net9.0 is compatible.  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.

Version Downloads Last Updated
1.3.0 419 8/26/2025
1.3.0-beta0001 199 8/26/2025
1.2.0 3,420 11/25/2024
1.2.0-beta0001 122 11/25/2024
1.1.0 2,115 2/24/2024
1.1.0-beta0001 167 2/24/2024
1.0.0 783 1/16/2024
1.0.0-beta0001 147 1/16/2024
0.1.0-beta0006 177 1/14/2024
0.1.0-beta0005 155 1/13/2024
0.1.0-beta0004 175 1/13/2024
0.1.0-beta0003 171 1/13/2024
0.1.0-beta0002 177 1/12/2024
0.1.0-beta0001 204 1/12/2024