Skip to content

Define how contains interacts with unevaluatedProperties #1135

Closed
@jdesrosiers

Description

@jdesrosiers

We recently (#1092) added support for contains to apply to objects, but we neglected to define how contains interacts with unevaluatedProperties. It should be consistent with how unevaluatedItems works.

Example

{
  "allOf": [
    {
      "type": "object",
      "contains": { "type": "number" }
    }
  ],
  "unevaluatedProperties": { "type": "boolean" }
}
{ "a": 1, "b": 2, "c": "NaN" }

Given this schema and instance, we should expect properties "a" and "b" to be "evaluated" and "c" to be unevaluated. "c" should be validated against the unevaluatedProperties schema and fail because it's not a boolean. However, currently unevaluatedProperties is only defined in terms of properties, patternProperties, additionalProperties, and itself, so contains doesn't create the relevant annotations and all of the properties will be considered unevaluated.

I'll create a PR soon to bring this in sync with the unevaluatedItems behavior.

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