Skip to content

Since 1.3.1: unevaluatedProperties doesn't work with external schemas #943

@aznan2

Description

@aznan2

If a schema contains all properties then unevaluatedProperties works as expected, but if some properties come from an external schema then they are ignored. So, given this instance:

{
  "type": "Point",
  "coordinates": [1, 1]
}

The following schema will work:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/point",
  "unevaluatedProperties": false,
  "$defs": {
    "point": {
      "properties": {
        "type": {
          "const": "Point"
        },
        "coordinates": {
          "type": "array"
        }
      }
    }
  }
}

But this will not, resulting in error messages relating to unevaluated properties $.type and $.coordinates:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "https://geojson.org/schema/Point.json",
  "unevaluatedProperties": false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions