From 4ffde56eceb072ad9799b122e15d9956f8643e21 Mon Sep 17 00:00:00 2001 From: wb-jm <117026294+ws-jm@users.noreply.github.com> Date: Fri, 4 Nov 2022 14:37:40 +0900 Subject: [PATCH] Update response-helpers.md (#42378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com> Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> --- docs/api-routes/response-helpers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api-routes/response-helpers.md b/docs/api-routes/response-helpers.md index 58477cf274cf..f2b8c93a8d1d 100644 --- a/docs/api-routes/response-helpers.md +++ b/docs/api-routes/response-helpers.md @@ -98,6 +98,8 @@ export default function handler( } ``` +> Note: The body of `NextApiRequest` is `any` because the client may include any payload. You should validate the type/shape of the body at runtime before using it. + To view more examples using types, check out the [TypeScript documentation](/docs/basic-features/typescript.md#api-routes). If you prefer to view your examples within a real projects structure you can checkout our examples repository: