Skip to content

Nested elements containing properties schemas incorrectly allow additional properties #96

Description

@simbo1905

Bug Description

The JTD validator incorrectly allows additional properties in nested elements schemas when the inner elements contain properties schemas with empty properties.

Failing Case

Schema:

Document:

Expected: Invalid (should reject additional property)
Actual: Valid (incorrectly passes validation)

Root Cause

The validator is not properly enforcing additionalProperties=false for properties schemas within nested elements. When elements contain elements that contain empty properties schemas, additional properties should be rejected by default per RFC 8927.

Test Case

The failing case from JtdExhaustiveTest property-based testing:

  • Outer elements schema contains inner elements schema
  • Inner elements schema contains properties schema with empty properties
  • Document contains inner objects with extra properties
  • Validation should fail but currently passes

This suggests the additionalProperties validation logic may not be correctly propagated through nested elements schemas.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions