docs: add callout for getValidatedRouterParams (#25057)

This commit is contained in:
Luke Nelson 2024-01-05 07:42:03 +00:00 committed by GitHub
parent 840b6b628d
commit b95163c7ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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