Skip to content

Options

Configuration Options

OptionTypeDefaultDescription
specSource{ type: "object"; spec: OpenAPISpec } | { type: "url"; spec: string } | { type: "file"; spec: string }Provide your OpenAPI 3.x spec as an object, or point to it via URL or file path.
responseSerializationResponseSerializationOptionssee belowControls serialization of outgoing responses.
fjs{ options: StringifyOptions}Configure fast-json-stringify instance.
precompileSchemasbooleanfalseCompile all response serializers during bootstrap to remove first‑hit latency.
debugbooleanfalseVerbose debug logs.

specSource

TypeTypeTypical use
"object"OpenAPISpecStatic spec object.
"url"stringLink to a centralized or externally hosted spec.
"file"stringLocal file path to a json file.

responseSerialization

OptionTypeDefaultDescription
enablebooleantrueEnable/disable serialization globally.
skipErrorResponsesbooleantrueSkip serializing error responses (status >= 400).
onSerializationFailed(args: { context: ExecutionContext; operationId?: string; statusCode: number; error: unknown; }) => void | neverCustom error handler. Transform/throw, or log and continue. Default logs a warning and throws 500.

fjs

OptionTypeDefaultDescription
optionsStringifyOptionsPass‑through options to fast-json-stringify

Released under the MIT License.