Deimdal.ExtractOpenApi 1.0.5

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

extract-open-api

A dotnet tool for reducing OpenApi specification documents by filtering out unnecessary operations. Schema v2 and v3 are supported

Usage

  1. Specify a source document (URL or file name)
  2. Specify destination document file name
  3. Specify a path filter (what path should be preserved) with an optional operation filter (see below)
  4. Specify optional parameters (if required): destination document version and format

Schema filter is not supported. Schema tree-shaking will be performed for preserved paths automatically

Path and operation filter

Please ensure your command shell allows symbols like { and }, or use escaped strings otherwise

Path filter can be:

  • Single -p /pet/{petId}/uploadImage
  • Multiple -p /pet/{petId}/uploadImage /pet/findByStatus /user/{username} /pet/findByTags

Path filter can contain operation filter:

  • Single operation -p /user/{username}=get (only GET operation for this path will be preserved in the final document)
  • Multiple operations -p /user/{username}=get,put (GET and PUT operations for this path will be preserved in the final document)

Installation (global tool)

dotnet tool install Deimdal.ExtractOpenApi --global

Usage command

extract-open-api -s <source OpenApi file or URL> -d <destination OpenApi file> -p <path filter 1> <path filter 2> <...>

Examples

Get specification from URL https://petstore.swagger.io/v2/swagger.json, preserve all operations for path /user/{username} and save a result to file spec.yaml in YAML format

extract-open-api -s https://petstore.swagger.io/v2/swagger.json -d spec.yaml -p /user/{username}

Get specification from URL https://petstore.swagger.io/v2/swagger.json, preserve all operations for path /store/inventory and GET operation for path /pet/{petId}, then save a result to file spec.yaml in YAML format

extract-open-api -s https://petstore.swagger.io/v2/swagger.json -d spec.yaml -p /store/inventory /pet/{petId}=get

Get specification from URL https://petstore.swagger.io/v2/swagger.json, preserve all operations for path /pet, /pet/{petId} and /store/inventory, then save a result to file spec.json in JSON format

extract-open-api -s https://petstore.swagger.io/v2/swagger.json -d spec.json -f json -p /pet /pet/{petId} /store/inventory

See help for full parameter usage details

extract-open-api -h

Local testing as a tool

  1. Create a package
    dotnet pack -c Release
    
  2. Uninstall any current versions (global in this example)
    dotnet tool uninstall Deimdal.ExtractOpenApi --global
    
  3. Install a local package (from the root of the solution in this example)
    dotnet tool install Deimdal.ExtractOpenApi --global --add-source .\Deimdal.ExtractOpenApi\nupkg --version 0.0.1
    
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 is compatible.  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.0.5 103 4/15/2026
1.0.4 100 4/9/2026
1.0.3 223 11/2/2025
1.0.2 148 8/3/2025
1.0.1 192 2/1/2025