Skip to content

Commit

Permalink
fix: type FastifyRequest id as a string (#4992)
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy committed Aug 26, 2023
1 parent 8974714 commit 889456f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/types/request.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const getHandler: RouteHandler = function (request, _reply) {
request.headers = {}

expectType<RequestQuerystringDefault>(request.query)
expectType<any>(request.id)
expectType<string>(request.id)
expectType<FastifyLoggerInstance>(request.log)
expectType<RawRequestDefaultExpression['socket']>(request.socket)
expectType<Error & { validation: any; validationContext: string } | undefined>(request.validationError)
Expand Down
2 changes: 1 addition & 1 deletion types/request.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface FastifyRequest<RouteGeneric extends RouteGenericInterface = Rou
// the RequestType (preferred) or swap Logger and RequestType arguments when
// creating custom types of FastifyRequest. Related issue #4123
> {
id: any;
id: string;
params: RequestType['params']; // deferred inference
raw: RawRequest;
query: RequestType['query'];
Expand Down

0 comments on commit 889456f

Please sign in to comment.