-
Notifications
You must be signed in to change notification settings - Fork 1
Content Formatting
NEWDAY\N17781 edited this page Mar 23, 2026
·
13 revisions
For fine-grained control over how request/response bodies and headers are formatted in diagram notes, use DiagramsFetcherOptions:
var options = new DiagramsFetcherOptions
{
PlantUmlServerBaseUrl = "https://plantuml.com/plantuml",
RequestPreFormattingProcessor = content => content,
RequestPostFormattingProcessor = content => content,
ResponsePreFormattingProcessor = content => content,
ResponsePostFormattingProcessor = content => content,
ExcludedHeaders = ["Authorization", "X-Api-Key"]
};| Property | Type | Default | Description |
|---|---|---|---|
PlantUmlServerBaseUrl |
string |
"https://plantuml.com/plantuml" |
Base URL of the PlantUML server. |
RequestPreFormattingProcessor |
Func<string, string>? |
null |
Transform raw request body before the library formats it into the PlantUML note. |
RequestPostFormattingProcessor |
Func<string, string>? |
null |
Transform the formatted request note after the library has formatted it. |
ResponsePreFormattingProcessor |
Func<string, string>? |
null |
Transform raw response body before the library formats it into the PlantUML note. |
ResponsePostFormattingProcessor |
Func<string, string>? |
null |
Transform the formatted response note after the library has formatted it. |
ExcludedHeaders |
IEnumerable<string> |
[] |
HTTP headers to exclude from diagram notes. |
SeparateSetup |
bool |
false |
When true, HTTP calls made before StartAction() are wrapped in a visual "Setup" partition in the diagram. See Diagram Customisation. |
HighlightSetup |
bool |
true |
When true (and SeparateSetup is enabled), the setup partition is rendered with a background colour. When false, the partition has no background colour. |
The formatting pipeline for each request/response is:
Raw body → PreFormattingProcessor → Library formatting (JSON pretty-print, header layout) → PostFormattingProcessor → Diagram note
Use cases:
- Pre-processor — Deserialise/transform the body before the library formats it (e.g., decrypt or decompress)
- Post-processor — Redact sensitive data, shorten values, or adjust the final note text
var options = new DiagramsFetcherOptions
{
// Remove bearer tokens from the formatted output
ResponsePostFormattingProcessor = note =>
Regex.Replace(note, @"Bearer [A-Za-z0-9\-._~+/]+=*", "Bearer ***"),
// Pretty-print XML before library formatting
RequestPreFormattingProcessor = body =>
{
try { return XDocument.Parse(body).ToString(); }
catch { return body; }
}
};Getting Started
Common Tasks
Integration Guides
- Integration xUnit3
- Integration xUnit2
- Integration NUnit
- Integration MSTest
- Integration TUnit
- Integration BDDfy xUnit3
- Integration LightBDD xUnit2
- Integration LightBDD xUnit3
- Integration LightBDD TUnit
- Integration ReqNRoll xUnit2
- Integration ReqNRoll xUnit3
- Integration ReqNRoll TUnit
Extensions
- Integration AtlasDataApi Extension
- Integration BigQuery Extension
- Integration Bigtable Extension
- Integration BlobStorage Extension
- Integration ClickHouse Extension
- Integration CloudStorage Extension
- Integration CosmosDB Extension
- Integration Dapper Extension
- Integration DynamoDB Extension
- Integration EF Core Relational Extension
- Integration Elasticsearch Extension
- Integration EventBridge Extension
- Integration EventHubs Extension
- Integration Grpc Extension
- Integration Kafka Extension
- Integration MassTransit Extension
- Integration MongoDB Extension
- Integration MySqlConnector Extension
- Integration Npgsql Extension
- Integration Oracle Extension
- Integration PubSub Extension
- Integration Redis Extension
- Integration S3 Extension
- Integration ServiceBus Extension
- Integration SNS Extension
- Integration Spanner Extension
- Integration SqlClient Extension
- Integration Sqlite Extension
- Integration SQS Extension
- Integration StorageQueues Extension
- Integration OpenTelemetry Extension
- Integration DispatchProxy Extension
- Integration MediatR Extension
- Integration PlantUML IKVM
Configuration
- Tracking Dependencies
- Tracking Custom Dependencies
- HTTP Tracking Setup
- Report Configuration
- Diagram Customisation
- Phase-Aware Tracking
- Content Formatting
- PlantUML Server Configuration
Features
- Generated Reports
- Search Syntax
- Component Diagrams
- PlantUML Browser Rendering
- Inline SVG Rendering
- Internal Flow Tracking
- Tags and Attributes
- Excluding Requests
- Excluded Headers
- Multi-Host Test Architectures
- Event-Driven Architecture Testing
- Service Bus Tracking Patterns
- Background Thread Correlation
- Parallel-Safe Background Correlation
- Event & Message Tracking
- Assertion Tracking
- Step Tracking
- Tabular Attributes
- Large Response and Diagram Handling
- Diagnostics and Debugging
- CI Summary Integration
- CI Artifact Upload
- Merging Parallel Reports
Reference