module Marten::Handlers::Schema::Callbacks
Overview
Provides the ability to define schema validation callbacks.
This module provides the ability to define callbacks that are executed before, after, after success or/and after failed validation of a schema. They allow to intercept the incoming request and to return early HTTP responses. Four hooks are enabled by the use of this module:
before_schema_validation
callbacks are executed before the validation of the schemaafter_schema_validation
callbacks are executed right after the validation of the schemaafter_successful_schema_validation
callbacks are executed right after the validation but only if the schema is validafter_failed_schema_validation
callbacks are executed right after the validation but only if the schema is not valid
Direct including types
Defined in:
marten/handlers/schema/callbacks.crMacro Summary
-
after_failed_schema_validation(*names)
Allows to define callbacks that are called after a failed schema validation.
-
after_schema_validation(*names)
Allows to define callbacks that are called after validating the schema (whether it's valid or not).
-
after_successful_schema_validation(*names)
Allows to define callbacks that are called after a successful schema validation.
-
before_schema_validation(*names)
Allows to define callbacks that are called before validating the schema.
Macro Detail
Allows to define callbacks that are called after a failed schema validation.
Those callbacks have access to the incoming #request
object and they can return a custom HTTP response.
If one of such callbacks returns a custom HTTP response, the following callbacks will be skipped and
this custom response will be returned by the handler right away.
Allows to define callbacks that are called after validating the schema (whether it's valid or not).
Those callbacks have access to the incoming #request
object and they can return a custom HTTP response.
If one of such callbacks returns a custom HTTP response, the following callbacks will be skipped and this
custom response will be returned by the handler right away.
Allows to define callbacks that are called after a successful schema validation.
Those callbacks have access to the incoming #request
object and they can return a custom HTTP response.
If one of such callbacks returns a custom HTTP response, the following callbacks will be skipped and this
custom response will be returned by the handler right away.
Allows to define callbacks that are called before validating the schema.
Those callbacks have access to the incoming #request
object and they can return a custom HTTP response.
If one of such callbacks returns a custom HTTP response, the following callbacks will be skipped and this
custom response will be returned by the handler right away.