Skip to content

The unevaluatedItems lesson needs work #61

Open
@jdesrosiers

Description

@jdesrosiers

The unevaluatedItems lesson is a lesson for items, not unevaluatedItems. While you can use unevaluatedItems in place of items and get the same result, this lesson does nothing to show an actual use case for the keyword. Notice that this passes the lesson.

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "age": {
      "type": "integer"
    },
    "skills": {
      "type": "array",
      "prefixItems": [
        { "enum": ["HTML", "CSS", "JavaScript"] },
        { "enum": ["HTML", "CSS", "JavaScript"] },
        { "enum": ["HTML", "CSS", "JavaScript"] }
      ],
      "items": { "type": "string" }
    }
  }
}

A lesson on unevaluatedItems should include extending and/or closing a tuple using an applicator of some kind. Here's an example of adding an item to the tuple and closing it to further extension.

{
  "$ref": "#/$defs/tuple",
  "prefixItems": [true, true, { "type": "number" }],
  "unevaluatedItems": false,

  "$defs": {
    "tuple": {
      "type": "array",
      "prefixItems": [
        "type": "string",
        "type": "boolean"
      ]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: AvailableNo one has claimed responsibility for resolving this issue.📝 DocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions