-
-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.2.1
Plugin version
No response
Node.js version
22.12.
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
windows 11
Description
I customized a request body schema ,including a json format object.
Here is the example.
type Literal = boolean | number | string | null | undefined
type Json = Literal | { [key: string]: Json } | Json[]
const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()])
const jsonSchema: z.ZodSchema = z.lazy(() => z.union([literalSchema, z.array(jsonSchema), z.record(z.string(), jsonSchema)]))
export const testModel = z.object({
id: z.string(),
content: jsonSchema.nullish()
})
When I open the Swagger UI url,it reports error: Could not resolve reference: Could not resolve pointer: /$defs/__schema0 does not exist in document.
How can I fix it ,or it just not match?
Link to code that reproduces the bug
1
Expected Behavior
No response
Metadata
Metadata
Assignees
Labels
No labels
