Global configuration
The decorators work with zero setup. Import the module to change defaults app-wide:
@Module({
imports: [
TypeFetchModule.forRoot({
validateRequest: true, // default
validateResponse: true, // default
coerce: true, // default
exposeResponseErrors: process.env.NODE_ENV !== 'production',
}),
],
})
export class AppModule {}Every option can also be overridden per endpoint: @TypeFetchEndpoint(endpoint, { validateResponse: false }).
Flat (non-structured) contracts
A request schema that isn't shaped as { path, query, body, headers } is "flat" — the client sends the whole input as the JSON body, and the server validates req.body against the whole schema. Both styles work with both decorators.