ApiTestSpark 1.0.0
See the version list below for details.
dotnet add package ApiTestSpark --version 1.0.0
NuGet\Install-Package ApiTestSpark -Version 1.0.0
<PackageReference Include="ApiTestSpark" Version="1.0.0" />
<PackageVersion Include="ApiTestSpark" Version="1.0.0" />
<PackageReference Include="ApiTestSpark" />
paket add ApiTestSpark --version 1.0.0
#r "nuget: ApiTestSpark, 1.0.0"
#:package ApiTestSpark@1.0.0
#addin nuget:?package=ApiTestSpark&version=1.0.0
#tool nuget:?package=ApiTestSpark&version=1.0.0
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.
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, orApiTestSparkExtensions
PR titles for changes touching PublicAPI.Shipped.txt must include SEMVER: MAJOR or SEMVER: MINOR.
License
MIT
| Product | Versions 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. |
-
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.
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.