Skip to content

additionalItems does not support $ref #408

@unional

Description

@unional

Describe the bug

The additionalItems should support schema including $ref

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "test": {
      "$ref": "#/definitions/Recur"
    }
  },
  "definitions": {
    "Recur": {
      "type": "array",
      "items": [
        {
          "type": "string",
          "enum": [
            "and"
          ]
        }
      ],
      "additionalItems": {
        "$ref": "#/definitions/Recur"
      }
    }
  }
}

VSCode Json Language Service used to have the same problem and is recently fixed:
microsoft/vscode-json-languageservice#69

So it is working on the json side:
image

Expected Behavior

schema including $ref should be supported for additionalItems for Tuple Validation:
https://json-schema.org/understanding-json-schema/reference/array.html#id6

Current Behavior

image

Steps to Reproduce

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions