Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serializerOpts to server option interface #3231

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions fastify.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { FastifyReply } from './types/reply'
import { FastifySchemaValidationError } from './types/schema'
import { ConstructorAction, ProtoAction } from "./types/content-type-parser";
import { Socket } from 'net'
import { Options as FJSOptions } from 'fast-json-stringify'

/**
* Fastify factory function for the standard fastify http, https, or http2 server instance.
Expand Down Expand Up @@ -102,6 +103,7 @@ export type FastifyServerOptions<
onProtoPoisoning?: ProtoAction,
onConstructorPoisoning?: ConstructorAction,
logger?: boolean | FastifyLoggerOptions<RawServer> | Logger,
serializerOpts?: FJSOptions,
mcollina marked this conversation as resolved.
Show resolved Hide resolved
serverFactory?: FastifyServerFactory<RawServer>,
caseSensitive?: boolean,
requestIdHeader?: string,
Expand Down
3 changes: 3 additions & 0 deletions test/types/fastify.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ expectAssignable<FastifyInstance>(fastify({ disableRequestLogging: true }))
expectAssignable<FastifyInstance>(fastify({ requestIdLogLabel: 'request-id' }))
expectAssignable<FastifyInstance>(fastify({ onProtoPoisoning: 'error' }))
expectAssignable<FastifyInstance>(fastify({ onConstructorPoisoning: 'error' }))
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { rounding: 'ceil' } }))
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { ajv: { missingRefs: 'ignore' } } }))
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { schema: { } } }))
expectAssignable<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>(fastify({ logger: true }))
expectAssignable<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyLoggerInstance>>(fastify({ logger: true }))
expectAssignable<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyLoggerInstance>>(fastify({
Expand Down