From b95163c7caaee937a9840c0f2dd377cc3bdd2726 Mon Sep 17 00:00:00 2001 From: Luke Nelson Date: Fri, 5 Jan 2024 07:42:03 +0000 Subject: [PATCH] docs: add callout for `getValidatedRouterParams` (#25057) --- docs/2.guide/2.directory-structure/1.server.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/2.guide/2.directory-structure/1.server.md b/docs/2.guide/2.directory-structure/1.server.md index 2dac8d9f86..95544572a3 100644 --- a/docs/2.guide/2.directory-structure/1.server.md +++ b/docs/2.guide/2.directory-structure/1.server.md @@ -158,6 +158,10 @@ export default defineEventHandler((event) => { }) ``` +::callout{icon="i-ph-lightbulb" color="green"} +Alternatively, use `getValidatedRouterParams` with a schema validator such as Zod for runtime and type safety. +:: + You can now universally call this API on `/api/hello/nuxt` and get `Hello, nuxt!`. ### Matching HTTP Method