docs:(zod-openapi): add note about app.route (#1088)

pull/985/merge
Yann Normand 2025-03-30 12:04:13 +10:00 committed by GitHub
parent b0e0d40be4
commit b70735cc6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -472,6 +472,18 @@ Be careful when combining `OpenAPIHono` instances with plain `Hono` instances. `
If you're migrating from plain `Hono` to `OpenAPIHono`, we recommend porting your top-level app, then working your way down the router tree.
When using the `.route()` method to mount a child OpenAPIHono app that uses path parameters, you should use the Hono *:param* syntax in the parent route path, rather than the OpenAPI *{param}* syntax:
```
const bookActionsApp = new OpenAPIHono()
...
// ❌ Incorrect: This will not match the route
app.route('/books/{bookId}', bookActionsApp)
// ✅ Using Hono parameter syntax
app.route('/books/:bookId', bookActionsApp)
```
### Header keys
Header keys that you define in your schema must be in lowercase.