Repository navigation
fix: omit absent compileSerializationSchema metadata instead of passing null - #7001
Merged
gurgunday merged 1 commit intoSep 26, 2026
Conversation
metcoder95
approved these changes
Sep 11, 2026
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.
Closes #6988.
compileSerializationSchemadefaulted both optional parameters tonull:so a custom serializer compiler called through
reply.compileSerializationSchema(schema)receivednullfor both.FastifyRouteSchemaDefdeclares them as optional strings and the reference docs describe the default asundefined, so the implementation was the odd one out.serializeInputalready declares the same two parameters without defaults and forwardsundefined, so this also makes the two paths agree.Dropping the defaults is the whole change. Existing tests that touch this assert
!httpStatusrather than a specific value, so they hold either way, and I could not find anywhere inlib,testortypesthat compares this tonull.Added one test asserting both values arrive as
undefinedwhen the metadata is not supplied. It fails without the change.Verified locally:
node --test test/internals/*.test.jsgives 395 passed / 0 failed,npm run test:typespasses all 16 files and 1282 assertions, and eslint is clean on both touched files.I left a separate note on #6987 about the cache-keying half, since fixing that one has a public API consequence for
getSerializationFunctionand I would rather agree the approach first.