fix(validation): match content-type with MIME parameters#426
Merged
fredbi merged 1 commit intogo-openapi:masterfrom May 4, 2026
Merged
fix(validation): match content-type with MIME parameters#426fredbi merged 1 commit intogo-openapi:masterfrom
fredbi merged 1 commit intogo-openapi:masterfrom
Conversation
`consumes` entries that carry MIME parameters (e.g. `text/plain;charset=utf-8`) were rejecting all client content types because validation compared the bare parsed media type against the raw allowed string. Parse both sides and accept when the bare types match and every client parameter is present on the allowed entry with the same value (allowed entry may carry extra parameters; an entry without parameters accepts any). Fixes go-openapi#136 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #426 +/- ##
==========================================
+ Coverage 81.69% 81.71% +0.02%
==========================================
Files 50 50
Lines 3381 3397 +16
==========================================
+ Hits 2762 2776 +14
- Misses 507 508 +1
- Partials 112 113 +1 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
consumesentries that carry MIME parameters (e.g.text/plain;charset=utf-8) were rejecting all client content types because validation compared the bare parsed media type against the raw allowed string. Parse both sides and accept when the bare types match and every client parameter is present on the allowed entry with the same value (allowed entry may carry extra parameters; an entry without parameters accepts any).Fixes #136
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist