Skip to content

Split structured scanning into RedactWire.Structured add-on#2

Merged
adamy merged 5 commits into
mainfrom
feature/split-structured-package
Jun 26, 2026
Merged

Split structured scanning into RedactWire.Structured add-on#2
adamy merged 5 commits into
mainfrom
feature/split-structured-package

Conversation

@adamy

@adamy adamy commented Jun 26, 2026

Copy link
Copy Markdown
Owner

What

Move JSON/XML/object scanning out of core RedactWire into a new opt-in package RedactWire.Structured, so the core library no longer carries a System.Text.Json dependency.

Why

Core is a regex/checksum detection library but pulled System.Text.Json transitively — for exactly one path (structured scanning) — forcing every string-only consumer onto STJ 10.x. RedactWire is 0.3.0 (pre-1.0), so this breaking move is cheap now, expensive later.

Changes

  • New src/RedactWire.Structured (netstandard2.0, Apache-2.0): JsonPiiScanner, XmlPiiScanner, ObjectPiiScanner, StructuredPiiMatch moved here (namespace RedactWire kept, so detector.DetectJson(...) extension methods resolve with just an added package ref). References core + System.Text.Json 10.0.9. Version 0.3.0 (tracks core).
  • Core: removed the System.Text.Json PackageReference (only dep now: Microsoft.Extensions.DependencyInjection.Abstractions) and the 3 static Redactor.DetectJson/Xml/Object forwarders.
  • Tests: structured tests moved to tests/RedactWire.Structured.Tests (references the add-on); core test project stays STJ-free.
  • Solution, release workflow (packs both packages), README / both nuget.md / CLAUDE.md updated.

⚠️ Breaking

Redactor.DetectJson/DetectXml/DetectObject removed (a static class can't be extension-method'd). With the add-on referenced, call Redactor.Default.DetectJson(...) or detector.DetectJson(...). Moved method signatures and detection behavior unchanged.

Verified

  • dotnet build 0 warnings (both projects TreatWarningsAsErrors); dotnet test 281 green (259 core + 22 structured).
  • Core packed nuspec: DI.Abstractions only — no System.Text.Json.
  • Add-on nuspec: depends on RedactWire + System.Text.Json.

🤖 Generated with Claude Code

adamy and others added 5 commits June 24, 2026 20:55
Core RedactWire no longer depends on System.Text.Json — it pulled STJ transitively
for exactly one path (structured scanning), forcing every string-only consumer onto
STJ 10.x. Pre-1.0, so the breaking move is cheap now.

- New package src/RedactWire.Structured (netstandard2.0): JSON/XML/object scanners +
  StructuredPiiMatch moved here, namespace RedactWire kept so detector.DetectX(...)
  extension methods still resolve with just an added package reference. References core
  + System.Text.Json. Version 0.3.0 (tracks core).
- Core: removed the System.Text.Json PackageReference (only dep now is
  DI.Abstractions) and the 3 Redactor.DetectJson/Xml/Object static forwarders.
  BREAKING: structured users call Redactor.Default.DetectJson(...) or detector.DetectX.
- Tests: structured tests moved to tests/RedactWire.Structured.Tests (references the
  add-on); core test project stays STJ-free. 281 total green (259 core + 22 structured).
- Solution, release workflow (packs both), README/nuget.md/CLAUDE.md updated.

No detection-behavior or moved-signature changes — packaging move only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ture

- /StructuredJson and /StructuredXml pages (was one combined page), each with its own
  sample and a culture selector. Sample references the RedactWire.Structured add-on.
- Fix noisy output: the DI detector has every built-in pack, so scanning structured data
  with no culture surfaced a generic 4-digit postcode/phone hit per country (67 matches
  on the sample JSON). Pages now pass the chosen culture to DetectJson/DetectXml -> 4.
- Nav: "Structured · JSON" / "Structured · XML".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Structured scanning split out of core is a breaking change — documented in CHANGELOG.md
and surfaced on NuGet via PackageReleaseNotes on both packages.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@adamy adamy merged commit 144cad1 into main Jun 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant