fix: extend type from fastify/ajv-compiler for ajv field in fastify options#6223
fix: extend type from fastify/ajv-compiler for ajv field in fastify options#6223gianmarco27 wants to merge 13 commits intofastify:mainfrom
Conversation
19707c0 to
36a5cfd
Compare
36a5cfd to
f6ba466
Compare
|
Thanks for the PR! Unfortunately, I don't know this part of the framework well enough to give quality feedback, so I will let an other contributor review your work. But I think you should write a test to prove that Typing tests are here: I am not sure where to write the integration test for |
|
Thank you for the quick feedback! I'll be on it ASAP |
Eomm
left a comment
There was a problem hiding this comment.
Fixed fastify/ajv-compiler#157
Closing
|
Hey @Eomm, i thin this is still missing in fastify, as the type, although fixed in ajv-compiler, is not being imported and proxied correctly from fastify types. (Bonus: some docs) Specifically referring to these changes: |
|
The oncreate and plugins options have been handled in 157 - if you think there is something still missing, please open a new PR or an issue with the snippet to reproduce the issue. I see the value in your link to generalize this part Lines 156 to 159 in 27e3fe3 |
As I was trying to add a custom validation pattern to Ajv through the
ajv.onCreateproperty, as suggested in the fastify/ajv-compiler documentation, I incurred in a TS error for theFastifyServerOptionsthat although proxies the entireajvproperty to the fastify/ajv-compiler builder method, does not expose correctly all of its properties into the typings.This small change in the typings correctly exposes the available options, and should be future proof as the type is directly derived from the fastify/ajv-compiler types.
Checklist
npm run testandnpm run benchmarkand the Code of conduct