Skip to content

Validator: fix false positives in duplicate schema fingerprinting (Rule 29) #731

@arjunmehta-git

Description

@arjunmehta-git

Context

Rule 29 detects duplicate schemas across constructs using a fingerprint based on property names and types.

Problem

Two schemas with the same property names but different:

  • `$ref` targets
  • Constraints (`minLength`, `pattern`, etc.)
  • `required` arrays
  • `description` values

...would produce the same fingerprint and be falsely flagged as duplicates.

Proposal

Improve the fingerprint function to include:

  • The full `$ref` path (not just the schema name)
  • The `required` array (sorted)
  • Constraint presence (e.g., has `minLength` vs doesn't)

This reduces false positive matches while still catching genuinely duplicated schemas.

Impact

Validator-only change. May surface new true duplicates or suppress current false positives.

References

Identified in schema validator audit — Section 4 (Robustness Issues).

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions