Skip to content

Commit

Permalink
Merge pull request #43 from driimus/fix/type-provider-assignability
Browse files Browse the repository at this point in the history
fix: allow assigning provider-enabled instances to `FastifyInstance`
  • Loading branch information
RafaelGSS authored Nov 16, 2022
2 parents cbd027e + eb0d670 commit 807e5b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const TypeBoxValidatorCompiler: FastifySchemaCompiler<TSchema> = ({ schem
* ```
*/
export interface TypeBoxTypeProvider extends FastifyTypeProvider {
output: this['input'] extends TSchema ? Static<this['input']> : never
output: this['input'] extends TSchema ? Static<this['input']> : unknown
}

/**
Expand Down
1 change: 1 addition & 0 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Fastify, { FastifyInstance, FastifyLoggerInstance, RawReplyDefaultExpress

const fastify = Fastify().withTypeProvider<TypeBoxTypeProvider>()
expectAssignable<FastifyInstance<RawServerDefault, RawRequestDefaultExpression, RawReplyDefaultExpression, FastifyLoggerInstance, TypeBoxTypeProvider>>(fastify)
expectAssignable<FastifyInstance>(fastify)

fastify.get('/', {
schema: {
Expand Down

0 comments on commit 807e5b2

Please sign in to comment.