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:

Direct including types

Defined in:

marten/handlers/schema/callbacks.cr

Macro Summary

Macro Detail

macro after_failed_schema_validation(*names) #

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.


[View source]
macro after_schema_validation(*names) #

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.


[View source]
macro after_successful_schema_validation(*names) #

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.


[View source]
macro before_schema_validation(*names) #

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.


[View source]