Merged
Conversation
Contributor
Author
|
Are the markdown linting errors to be expected? I can have a go at fixing them if you wish. |
7fd86fb to
6f46b78
Compare
gurgunday
approved these changes
Jan 2, 2026
Member
gurgunday
left a comment
There was a problem hiding this comment.
lgtm
thanks for the changes, and happy holidays :)
Eomm
approved these changes
Jan 3, 2026
Member
Eomm
left a comment
There was a problem hiding this comment.
Lint failure not related to this PR
maybe a GHA update gone wrong
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.
First of all: Happy holidays! :)
The reason for this PR stems from #6223
Below i enumerate the two issues i found, with a bullet list:
Currently, in a TS project if I try to use the
onCreateajv option I still get met with a typescript error (requiring a ts-expect-error), as such option is not defined in the exposed fastify type, although made available byfastify/ajv-compiler(My suggested fix is to mirror the entire ajv options field type definition from the
ajv-compileritself, as fastify already proxies the object to it in the js implementation, this way the type definitions remain transparent to the implementation and future updates)Additionally I have added also a test to showcase an error in the current ajv plugin type definition where the override of the plugin types is too generous, and allows for plugins to be passed, that would break the ajv plugin definition fluent standard, so if i provide my own validatorCompiler, leveraging this Ajv feature, i get no warning from TS to alert me that perhaps these plugins might break my implementation because they are not returning the Ajv instance.
(Again proxying the type directly from the library solves this as it enforces the Ajv plugin definition)
I have committed types tests showcasing the 2 different use cases above, that would fail with the current type definition and following them up with the related fix, together with the dependency update of
fastify/ajv-compilerthat is required to apply these improvements.Lastly I have added a small enrichment in docs for the ajv options and a little fix in jsdocs for fastify which i found while browsing the js code.
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct