zod
zod copied to clipboard
`z.ref`
There is a special usage in JSON Schema:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"root": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"arguments": {
"type": "array"
},
"children": {
"type": "array",
"items": {
"$ref": "#/properties/root"
}
},
}
}
},
"required": [
"root"
]
}
$ref
means use a defined structure in the tree.
Have zod a similar function or not? If not, there is any posibility add it?
I try to use a defined structure in Zod, but the ts-server says the types are loop used