From b7317bbb4c329c5ec693534cd9e6e70e4bcb78a3 Mon Sep 17 00:00:00 2001 From: Swikar Sharma Date: Thu, 28 Dec 2023 03:54:12 +0545 Subject: [PATCH] major typo in schema.md The Elysia schema api is described wrong. --- docs/essential/schema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/essential/schema.md b/docs/essential/schema.md index 0f643cc9..6791d231 100644 --- a/docs/essential/schema.md +++ b/docs/essential/schema.md @@ -69,14 +69,14 @@ The response should be listed as follows: Register hook into **every** handler that came after. -To add a global hook, you can use `.schema` followed by a life cycle event in camelCase: +You can add validation schema in global hooks: ```typescript import { Elysia } from 'elysia' new Elysia() .get('/none', () => 'hi') - .schema({ // [!code ++] + .onBeforeHandle({ // [!code ++] query: t.Object({ // [!code ++] name: t.String() // [!code ++] }) // [!code ++]