fastify 4.23.1 → 4.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fastify.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- const VERSION = '4.23.1'
3
+ const VERSION = '4.23.2'
4
4
 
5
5
  const Avvio = require('avvio')
6
6
  const http = require('node:http')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify",
3
- "version": "4.23.1",
3
+ "version": "4.23.2",
4
4
  "description": "Fast and low overhead web framework, for Node.js",
5
5
  "main": "fastify.js",
6
6
  "type": "commonjs",
@@ -81,6 +81,7 @@ const getHandler: RouteHandler = function (request, _reply) {
81
81
  expectType<FastifyContext<ContextConfigDefault>['config']>(request.routeOptions.config)
82
82
  expectType<ContextConfigDefault & FastifyRouteConfig & FastifyContextConfig>(request.routeOptions.config)
83
83
  expectType<FastifySchema>(request.routeSchema)
84
+ expectType<FastifySchema>(request.routeOptions.schema)
84
85
 
85
86
  expectType<RequestHeadersDefault & RawRequestDefaultExpression['headers']>(request.headers)
86
87
  request.headers = {}
@@ -20,16 +20,17 @@ export interface ValidationFunction {
20
20
  errors?: null | ErrorObject[];
21
21
  }
22
22
 
23
- export interface RequestRouteOptions<ContextConfig = ContextConfigDefault> {
24
- method: string,
25
- url: string,
26
- bodyLimit:number,
27
- attachValidation:boolean,
28
- logLevel:string,
29
- version: string | undefined,
30
- exposeHeadRoute: boolean,
31
- prefixTrailingSlash: string,
32
- config: FastifyContextConfig & FastifyRouteConfig & ContextConfig
23
+ export interface RequestRouteOptions<ContextConfig = ContextConfigDefault, SchemaCompiler = FastifySchema> {
24
+ method: string;
25
+ url: string;
26
+ bodyLimit:number;
27
+ attachValidation:boolean;
28
+ logLevel:string;
29
+ version: string | undefined;
30
+ exposeHeadRoute: boolean;
31
+ prefixTrailingSlash: string;
32
+ config: FastifyContextConfig & FastifyRouteConfig & ContextConfig;
33
+ schema: SchemaCompiler;
33
34
  }
34
35
 
35
36
  /**
@@ -79,7 +80,7 @@ export interface FastifyRequest<RouteGeneric extends RouteGenericInterface = Rou
79
80
  readonly method: string;
80
81
  readonly routerPath: string;
81
82
  readonly routerMethod: string;
82
- readonly routeOptions: Readonly<RequestRouteOptions<ContextConfig>>
83
+ readonly routeOptions: Readonly<RequestRouteOptions<ContextConfig, SchemaCompiler>>
83
84
  readonly is404: boolean;
84
85
  readonly socket: RawRequest['socket'];
85
86