dotnet-sdlexport 0.0.24

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


<a href="" target="_blank"><img src="" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>


codecov Nuget NuGet

GitHub Release Date GitHub commits since latest release (by date) Size

GitHub contributors Activity Activity Activity

Run unit tests Publish preview to GitHub registry Publish release to Nuget registry CodeQL analysis

.NET Core Global Tool for generating SDL from url or executable file.


You can install the latest version via NuGet.

> dotnet tool install -g dotnet-sdlexport

Command Line Options

Just type

> sdlexport

to see all available options. See CommandLineOptions for more information.

What is it ?

This tool generates a text SDL (Schema Definition Language) file from the given URL or path to the executable ASP.NET Core assembly. In the case of using URL, the tool immediately sends introspection request to that URL. If the path to the file is specified as the source, then the tool starts the temporary process and stops it after receiving the introspection response. The tool will be able to send requests only when it starts the process on the URL it knows. This parameter is passed through the --url command line switch and has default value http://localhost:8088. This parameter is then passed as the --server.urls command line switch to the process being launched.

It should be noted that with this method, the service should not (although it may) perform any side work at startup, such as contacting external systems, databases, etc. as this may slow down the process of obtaining the schema. The tool passes API_ONLY_RESTRICTED_ENVIRONMENT command line key to the process being launched. By the presence of this key, it is possible to disable the execution of code that is not required to obtain a schema:

public static Task Main(string[] args) => CreateBuilder(args)

private static IWebHostBuilder CreateBuilder(string[] args)
    ? WebHost.CreateDefaultBuilder<StartupApiOnly>(args)
    : WebHost.CreateDefaultBuilder<Startup>(args);

Why do I need it ?

SDL is easier to work with than with raw JSON introspection response. SDL is easier to read and understand. SDL is also much more compact in comparison with raw JSON - in this case it's easier to track changes. SDL file, like any code file, can be stored as an artifact in the version control system and act as a service public API.

Experimental features

The tool can get information about directives if the server supports this feature. If the server does not support directive return (in this case server returns a request validation error), then the tool uses the classic introspection request. The official specification does not describe such a possibility, although discussions are underway to expand the specification to add this feature.


  1. GitHub GraphQL API v4 [Generated SDL]
sdlexport --source --auth bearer|<YOUR_TOKEN> --out samples/github.graphql
  1. SWAPI - A GraphQL schema and server wrapping Star Wars API. [Generated SDL]
sdlexport --source --out samples/swapi.graphql
  1. HIVDB - A curated database to represent, store and analyze HIV drug resistance data. [Generated SDL]
sdlexport --source --out samples/hivdb.graphql
  1. Countries - Information about countries, continents, and languages, based on Countries List. [Generated SDL]
sdlexport --source --out samples/countries.graphql
  1. You can export the schema directly from your published ASP.NET Core app
> sdlexport --source C:\MyWebHost.dll --out samples/myschema.graphql

To see the full list of available options:

> sdlexport

See also

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 is compatible.  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 was computed.  net8.0-android 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 netcoreapp3.1 is compatible. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.0.24 250 4/24/2023
0.0.23 179 4/21/2023
0.0.22 225 3/7/2023
0.0.21 215 3/7/2023
0.0.20 325 12/2/2022
0.0.19 473 2/17/2022
0.0.18 331 8/2/2021
0.0.17 348 4/28/2021
0.0.16 304 4/22/2021
0.0.15 313 4/20/2021
0.0.14 323 4/15/2021
0.0.13 330 3/25/2021
0.0.12 292 3/16/2021
0.0.11 461 10/25/2020
0.0.10 400 10/21/2020
0.0.9 368 10/21/2020
0.0.8 357 9/10/2020
0.0.7 420 7/24/2020
0.0.6 408 7/6/2020
0.0.5 408 4/23/2020
0.0.4 420 3/20/2020
0.0.3 421 2/4/2020
0.0.2 614 12/28/2019
0.0.1 581 12/28/2019