Skip to content

Simplified: Fix Header Parsing#944

Merged
wolveix merged 3 commits intomainfrom
fix-header-parsing
Jan 17, 2026
Merged

Simplified: Fix Header Parsing#944
wolveix merged 3 commits intomainfrom
fix-header-parsing

Conversation

@wolveix
Copy link
Copy Markdown
Collaborator

@wolveix wolveix commented Jan 17, 2026

Previously, the findHeaders func ignored structs as headers were intended to only be set at the top-level of the output struct. This worked; however, there was a subtle bug within _findInType that meant this was ignored if a field was a struct slice (or array, or map) rather than just a single struct.

This introduced various issues, namely the documentation and setting of headers from struct slices, which was particularly problematic for []*http.Cookie. This fix adjusts the struct type detection to automatically detect arrays, maps, and slices and check their root type.

This PR also implements support for hidden headers (nested or otherwise) from the generated OpenAPI documentation.

This PR:


I created this as an improved and simplified version of #943 which doesn't require recursive field resolution. This means it doesn't close as many issues as it doesn't implement new functionality, but does resolve a few bugs.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.62%. Comparing base (1cd5c26) to head (2075587).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #944      +/-   ##
==========================================
+ Coverage   92.54%   92.62%   +0.07%     
==========================================
  Files          23       23              
  Lines        4481     4499      +18     
==========================================
+ Hits         4147     4167      +20     
+ Misses        275      274       -1     
+ Partials       59       58       -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.

@wolveix wolveix merged commit 88c6cda into main Jan 17, 2026
7 checks passed
@wolveix wolveix deleted the fix-header-parsing branch January 17, 2026 23:15
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.

Applying common headers to multiple responses (docs issue) Docs UI doesn't handle multiple cookies properly

1 participant