Skip to content

allOf + unevaluatedProperties does not work #1219

Description

@dukhaSlayer

Describe the bug

I'm trying to build a mixin schema with:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/test.schema.json",
  "title": "Test",
  "type": "object",
  "allOf": [
    { "$ref": "#/$defs/FieldsA" },
    { "$ref": "#/$defs/FieldsB" }
  ],
  "unevaluatedProperties": false,
  "$defs": {
    "FieldsA": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "name": { "type": "string" },
        "age": { "type": "integer" }
      },
      "required": ["name"]
    },
    "FieldsB": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "email": { "type": "string", "format": "email" },
        "phone": { "type": "string" }
      },
      "required": ["email"]
    }
  }
}

And data being

# yaml-language-server: $schema=./test.schema.yaml

name: John Doe
age: 30
email: john@example.com
phone: "+1234567890"
#foo: bar  # <- uncomment to test: should be rejected by unevaluatedProperties

Testing on both release and nightly (1.22 or 1.22.2026022708)

Other packages validate it perfectly. E.g.:

uv run check-jsonschema --schemafile data/test/test.schema.yaml data/test/test.yaml
ok -- validation done

Expected Behavior

Document pass validation with (name+email) or e.g. (name + email + phone). And don't pass on foo field.

Current Behavior

Every field in my document shows an error "Property {} is not allowed"

Image

Steps to Reproduce

Create 2 files, open data file.

Environment

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions