dry-scarletD
VAPI5mo ago
dry-scarlet

Recursive JSON Schema for Tool Parameters

Hey @Vapi Team , I'm running into an issue with the validation of a tool's JSON schema and was hoping to get some clarification.

After a bit of debugging, I've received specific errors stating that property $defs should not exist within the tool's parameters. This suggests that standard recursive schema definitions aren't supported. Could you please confirm if this is a known limitation, and if there's a recommended workaround for handling recursive structures? For context, I'm trying to implement a schema like the one below. Thanks!

{
  "name": "Test",
  "parameters": {
    "type": "object",
    "$defs": {
      "selectedOption": {
        "type": "object",
        "properties": {
          "selectedOptions": {
            "type": "array",
            "items": { "$ref": "#/$defs/selectedOption" }
          }
        }
      }
    },
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "selectedOptions": {
              "type": "array",
              "items": { "$ref": "#/$defs/selectedOption" }
            }
          }
        }
      }
    }
  }
}
Was this page helpful?