Skip to content

feat(json,yaml): added support for redactor function - #111

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:feat/json-redact
Apr 26, 2026
Merged

feat(json,yaml): added support for redactor function#111
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:feat/json-redact

Conversation

@fredbi

@fredbi fredbi commented Apr 26, 2026

Copy link
Copy Markdown
Member

JSON and YAML assertions (generic variants only) now accept a function in addition to the usual string|[]byte inputs.

This allows for dynamic parameterization and redaction of expected or actual values before a comparison.

Upstream reference: stretchr#1840

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.
JSON and YAML assertions (generic variants only) now accept a function
in addition to the usual string|[]byte inputs.

This allows for dynamic parameterization and redaction of expected or
actual values before a comparison.

Upstream reference: stretchr#1840

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi merged commit 7af5b77 into go-openapi:master Apr 26, 2026
21 checks passed
@fredbi
fredbi deleted the feat/json-redact branch April 26, 2026 11:31
@codecov

codecov Bot commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.69%. Comparing base (18cbdcc) to head (b1bfef0).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   91.68%   91.69%   +0.01%     
==========================================
  Files          97       97              
  Lines       12585    12602      +17     
==========================================
+ Hits        11539    11556      +17     
  Misses        825      825              
  Partials      221      221              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant