docs: add "how to register schema with refs" (#294)
parent
186ce0db8e
commit
80f46a4c40
|
@ -51,6 +51,10 @@ const UserSchema = z
|
||||||
.openapi('User')
|
.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:
|
Next, create a route:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|
Loading…
Reference in New Issue