OpenAPI JSON Serializer
This serializer processes JSON payloads for the OpenAPIHandler and supports native data types.
Extending Native Data Types
Customize serialization by creating your own StandardOpenAPICustomJsonSerializer and adding it to the customJsonSerializers option.
Define Your Custom Serializer
tsimport type { StandardOpenAPICustomJsonSerializer } from '@orpc/openapi-client/standard' export class { constructor( public readonly : string, public readonly : string, public readonly : string, public readonly : number, ) {} () { return { : this., : this., : this., : this., } } } export const : StandardOpenAPICustomJsonSerializer = { : => instanceof , : => .toJSON(), }Use Your Custom Serializer
tsconst = new (, { : [], }) const = new ({ : [], })INFO
It is recommended to add custom serializers to the
OpenAPIGeneratorfor consistent serialization in the OpenAPI document.
