@foal/core
Version:
Full-featured Node.js framework, with no complexity
18 lines (17 loc) • 751 B
TypeScript
import { HookDecorator } from '../../core';
/**
* Hook - Validate a specific query parameter against an AJV schema.
*
* @export
* @param {string} name - Query parameter name.
* @param {(object | ((controller: any) => object))} [schema={ type: 'string' }] - Schema used to
* validate the query parameter.
* @param {{ openapi?: boolean, required?: boolean }} [options={}] - Options.
* @param {boolean} [options.openapi] - Add OpenApi metadata.
* @param {boolean} [options.required] - Specify is the query is optional.
* @returns {HookDecorator} The hook.
*/
export declare function ValidateQueryParam(name: string, schema?: object | ((controller: any) => object), options?: {
openapi?: boolean;
required?: boolean;
}): HookDecorator;