Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z.ref #3715

Open
sheepbox8646 opened this issue Aug 18, 2024 · 0 comments
Open

z.ref #3715

sheepbox8646 opened this issue Aug 18, 2024 · 0 comments

Comments

@sheepbox8646
Copy link

sheepbox8646 commented Aug 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant