Skip to content

Vertices is not defined in the example in 10.4 Output Sturucture #824

Closed
@bwicklund

Description

@bwicklund

The following schema is defined

{
  "$id": "https://example.com/polygon",
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$defs": {
    "point": {
      "type": "object",
      "properties": {
        "x": { "type": "number" },
        "y": { "type": "number" }
      },
      "additionalProperties": false,
      "required": [ "x", "y" ]
    }
  },
  "type": "array",
  "items": { "$ref": "#/$defs/point" },
  "minItems": 3
}

With the following instance given:

[
  {
    "x": 2.5,
    "y": 1.3,
  },
  {
    "x": 1,
    "z": 6.7
  }
]

You call out the errors this instance will produce as the following:

The second element in the "vertices" property is missing a "y" property.
The second element in the "vertices" property has a disallowed "z" property.
There are only two vertices, but three are required.

vertices is not defined anywhere; only the object name "point" is mentioned in the schema, It would be a lot of any interpreter to infer these individual points to be "vertices."

I would suggest this edit:

The second "point" object is missing a "y" property.
The second "point" object has a disallowed "z" property.
There are only two "point"', but three are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationItems that need to be clarified in the specificationcore

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions