Skip to content

Support JSON Schema allOf, oneOf, etc. #496

@jpmcb

Description

@jpmcb

Describe the bug

It doesn't look like the Inspector supports allOf, oneOf, or other JSON schema like joins:

For example, for a valid JSON schema like so being sent to the inspector:

{
  "tools": [
    {
      "name": "POST_f9e30d74-56ca-4f1e-bcb3-75fe305ea5e4",
      "description": "Creates a todo list item.",
      "inputSchema": {
        "type": "object",
        "required": [
          "userId",
          "title"
        ],
        "allOf": [
          {
            "type": "object",
            "title": "Todo Insert Schema",
            "required": [
              "userId",
              "title",
              "completed"
            ],
            "additionalProperties": false,
            "properties": {
              "userId": {
                "type": "integer",
                "description": "The userId that created the todo list item.",
                "examples": [
                  1
                ]
              },
              "title": {
                "type": "string",
                "description": "The title of the todo list item.",
                "examples": [
                  "Wash the dishes"
                ]
              },
              "completed": {
                "type": "boolean",
                "description": "Whether or not the todo list item is completed.",
                "examples": [
                  false
                ]
              }
            }
          }
        ]
      }
    }
  ]
}

I'm getting nothing in the actual tool invocation:

Image

which will obviously fail because it's missing required params.

To Reproduce

Steps to reproduce the behavior:

  1. Build a tool with a schema that uses allOf or oneOf
  2. Notice that the inspector doesn't consume that correctly

Expected behavior

Because the specification defines inputSchema to be:

inputSchema: JSON Schema defining expected parameters

I'd expect any JSON schema to work here. Not just simple { type: object, properties: { ... } } - this is especially problematic since some libraries and tools may attempt to do fancier consolidation of JSON schema based on programmatic params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtoolsIssues related to testing tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions