Attaches a request body schema to the decorated route handler.
The schema is enforced (invalid bodies answered with 400) when a
CAPABILITIES.VALIDATION provider is registered and enforceSchemas is not
false; otherwise it remains description-only. See the module documentation.
The first-party validation service requires application/json or an
application/*+json media type; options.forms: true also accepts form types.
An unsupported or absent type answers 415 before any body read. A replacement
service owns its own media-type handling. Cookie-authenticated routes still
need csrfMiddleware or csrfFormMiddleware; pair opted-in forms with the latter.
Attaches a request body schema to the decorated route handler.
The schema is enforced (invalid bodies answered with
400) when aCAPABILITIES.VALIDATIONprovider is registered andenforceSchemasis notfalse; otherwise it remains description-only. See the module documentation.The first-party validation service requires
application/jsonor anapplication/*+jsonmedia type;options.forms: truealso accepts form types. An unsupported or absent type answers 415 before any body read. A replacement service owns its own media-type handling. Cookie-authenticated routes still needcsrfMiddlewareorcsrfFormMiddleware; pair opted-in forms with the latter.