From 80f46a4c40d006d34fa1f9afc07ddca9f860aaa8 Mon Sep 17 00:00:00 2001 From: Sor4chi <80559385+sor4chi@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:31:03 +0900 Subject: [PATCH] docs: add "how to register schema with refs" (#294) --- packages/zod-openapi/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/zod-openapi/README.md b/packages/zod-openapi/README.md index d3137bc9..e592d582 100644 --- a/packages/zod-openapi/README.md +++ b/packages/zod-openapi/README.md @@ -51,6 +51,10 @@ const UserSchema = z .openapi('User') ``` +> [!TIP] +> `UserSchema` schema will be registered as `"#/components/schemas/User"` refs in the OpenAPI document. +> If you want to register the schema as referenced components, use `.opanapi()` method. + Next, create a route: ```ts