You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/zod-openapi/README.md
+71-5
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,7 @@ const UserSchema = z
52
52
```
53
53
54
54
> [!TIP]
55
+
>
55
56
> `UserSchema` schema will be registered as `"#/components/schemas/User"` refs in the OpenAPI document.
56
57
> If you want to register the schema as referenced components, use `.openapi()` method.
57
58
@@ -114,6 +115,71 @@ You can start your app just like you would with Hono. For Cloudflare Workers and
114
115
exportdefaultapp
115
116
```
116
117
118
+
> [!IMPORTANT]
119
+
> The request must have the proper `Content-Type` to ensure the validation. For example, if you want to validate a JSON body, the request must have the `Content-Type` to `application/json` in the request. Otherwise, the value of `c.req.valid('json')` will be `{}`.
0 commit comments