Repository navigation
fix: when version is an array with neutral version - #9585
Merged
Merged
Conversation
on header and media type versioning, on the express adapter
Pull Request Test Coverage Report for Build 2932a840-1413-4100-9224-94da6d81e1d1
💛 - Coveralls |
jmcdo29
approved these changes
May 17, 2022
3 of 15 tasks
Tony133
approved these changes
May 17, 2022
4 of 12 tasks
kamilmysliwiec
pushed a commit
that referenced
this pull request
Sep 14, 2026
…7705) * fix(fastify): derive neutral version when accept header is absent With MEDIA_TYPE versioning, a request without an Accept header initialized the version parameter to '' instead of undefined, so the isUndefined guard added in #9585 (whose comment says 'No version was supplied') never fired. The derived constraint became undefined and find-my-way skipped routes registered with [VERSION_NEUTRAL, ...] arrays, returning 404. The HEADER branch of the same function, the present-but-versionless Accept sub-case, and the Express adapter all resolve this case to VERSION_NEUTRAL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test(fastify): address review feedback on version filter specs Fold the standalone media-type repro spec into fastify-adapter.spec.ts as an applyVersionFilter describe block, dropping both any casts by typing the options as VersioningOptions and passing the version array directly (VersionValue accepts Array<string | typeof VERSION_NEUTRAL>). Add integration coverage: a route versioned [VERSION_NEUTRAL, '2'] plus a No Header case in both media-type versioning e2e suites. The express suite passes on the current adapter; the fastify case exercises the fix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: closes #9581
What is the new behavior?
now having
version: [VERSION_NEUTRAL]will behave the same asversion: VERSION_NEUTRALDoes this PR introduce a breaking change?
Other information
I've tested those changes with both adapters in a local project of mine