Skip to content

Context.Json should not unwrap response #2964

Merged
aldas merged 1 commit intolabstack:masterfrom
aldas:context_json_donot_unwrap
May 1, 2026
Merged

Context.Json should not unwrap response #2964
aldas merged 1 commit intolabstack:masterfrom
aldas:context_json_donot_unwrap

Conversation

@aldas
Copy link
Copy Markdown
Contributor

@aldas aldas commented May 1, 2026

Context.Json should not unwrap response and just wrap Response so other middlewares can use their own "wrapping" Responses and see the status code.

I found this during #2895 when to tried to create middleware that wraps existing response to own and status code setting did not work anymore with Context.JSON (always sends 200 to client).

…er middlewares can use their own "wrapping" Responses and see the status code.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.18%. Comparing base (b12f646) to head (b593bc3).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2964      +/-   ##
==========================================
+ Coverage   93.08%   93.18%   +0.10%     
==========================================
  Files          43       43              
  Lines        4510     4507       -3     
==========================================
+ Hits         4198     4200       +2     
+ Misses        195      189       -6     
- Partials      117      118       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aldas aldas merged commit f16f84d into labstack:master May 1, 2026
10 checks passed
@aldas aldas deleted the context_json_donot_unwrap branch May 1, 2026 18:32
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