ApiTestSpark 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package ApiTestSpark --version 1.0.1
                    
NuGet\Install-Package ApiTestSpark -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ApiTestSpark" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ApiTestSpark" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ApiTestSpark" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ApiTestSpark --version 1.0.1
                    
#r "nuget: ApiTestSpark, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ApiTestSpark@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ApiTestSpark&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ApiTestSpark&version=1.0.1
                    
Install as a Cake Tool

ApiTestSpark

NuGet NuGet Downloads

NuGet: https://www.nuget.org/packages/ApiTestSpark Live Site: https://apitest.makeboldspark.com

Embed the API Test Spark React SPA into any .NET 10 Minimal API project with a single method call. Autodiscovers your OpenAPI v3 endpoints and renders an interactive test UI at /api-test-spark/.

About

API Test Spark is a lightweight developer tool for testing and debugging REST APIs. Install it into any .NET Minimal API project and it automatically discovers your endpoints via OpenAPI v3, rendering an interactive test harness at /api-test-spark/.

Built by Mark Hazleton — Mark Hazleton, Solutions Architect API Test Spark is part of the Make Bold Spark portfolio of technical demonstrations.

Install

dotnet add package ApiTestSpark

Quickstart

// Program.cs — minimal setup
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenApi();
var app = builder.Build();
app.MapOpenApi();
app.MapApiTestSpark();   // serves at /api-test-spark/
app.Run();

Navigate to https://localhost:{port}/api-test-spark/ to open the harness.

With auth and custom headers

app.MapApiTestSpark(options =>
{
    options.OpenApiUrl      = "/openapi.json";   // default
    options.AuthScheme      = "Bearer";          // pre-populates auth field in UI
    options.DefaultHeaders["X-Tenant-Id"] = "acme";  // injected into every request
    options.Environments    = ["Development", "Staging"];
});

Local development (Vite dev server)

If you run the React SPA on a separate dev server (e.g. Vite on :5151) alongside your .NET API (e.g. on :5000), the same-origin CORS policy will block the SPA's config fetch. Add your dev origin:

app.MapApiTestSpark(options =>
{
    options.CorsOrigins = ["http://localhost:5151"];
});

Behind a reverse proxy

Call UseForwardedHeaders() before MapApiTestSpark() so baseUrl in the config response reflects the public-facing URL:

app.UseForwardedHeaders();
app.MapApiTestSpark();

Diagnostics / logging

The harness uses the ApiTestSpark logger category. To enable verbose asset logging without redeploying, add to appsettings.json at runtime:

{
  "Logging": {
    "LogLevel": {
      "ApiTestSpark": "Debug"
    }
  }
}

Or set options.EnableVerboseLogging = true in code.

How this package is built

For a detailed technical walkthrough of the packaging approach — MSBuild/Vite bridge, embedded resources, Source Link, public API tracking, CI/CD pipeline, and security configuration — see NUGET-PACKAGE-WALKTHROUGH.md.

NuGet: https://www.nuget.org/packages/ApiTestSpark Source: github.com/MarkHazleton/ApiTestSpark

SPA routing note

The harness uses client-side SPA routing. All extensionless paths under /api-test-spark/ return HTTP 200 with index.html — the React router handles invalid paths client-side. WAF rules should not expect HTTP 404 for SPA routes.

Semver policy

  • Patch (x.y.Z): bug fixes, no public API changes
  • Minor (x.Y.0): additive features, no breaking changes
  • Major (X.0.0): breaking changes to MapApiTestSpark, ApiTestSparkOptions, or ApiTestSparkExtensions

PR titles for changes touching PublicAPI.Shipped.txt must include SEMVER: MAJOR or SEMVER: MINOR.

License

MIT

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

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
1.3.0 40 6/6/2026
1.2.0 53 6/3/2026
1.1.0 126 5/31/2026
1.0.2 93 5/30/2026
1.0.1 87 5/30/2026
1.0.0 77 5/30/2026

1.0.0 — Initial release. MapApiTestSpark() embeds an interactive React API
     test UI at /api-test-spark/ in any .NET 10 Minimal API. Autodiscovers OpenAPI v3 endpoints.
     Renders sortable response tables and editable object forms. Generates curl commands. Includes
     draggable debug panel and Azure Application Insights integration. See CHANGELOG.md for full
     history.