function validateBody
validateBody(schema: unknown): MiddlewareFunction

Validate the request body against a schema.

Delegates to the configured IValidationService so the error format matches the plugin registration (e.g. 'rfc9457').

Parameters

schema: unknown

The schema (must expose safeParse)

Return Type

MiddlewareFunction

A middleware function

Usage

import { validateBody } from "validation-plugin/src/index.ts";