Skip to content

Combine type error messages into a single meaningful error - #147

Merged
jdesrosiers merged 4 commits into
hyperjump-io:mainfrom
srivastava-diya:feature/type-handler-clean
Jan 28, 2026
Merged

jdesrosiers merged 4 commits into
hyperjump-io:mainfrom
srivastava-diya:feature/type-handler-clean

Conversation

@srivastava-diya

Copy link
Copy Markdown
Contributor

Description

Fixes #133

Currently, when multiple type keywords apply at the same instance location (e.g. through allOf), the validator emits multiple type error messages, which results in noisy output for users.

Changes made

  • Collect all failed type keyword locations
  • Intersect allowed types across schemas
  • Emit a single consolidated type error message

Notes

  • Treats integer as a subset of number during intersection
  • Falls back to getUnknownErrorMessage("type") when no valid type remains

Comment thread src/error-handlers/type.js Outdated
Comment thread src/test-suite/tests/type.json Outdated
Comment thread src/test-suite/tests/type.json Outdated
@srivastava-diya
srivastava-diya force-pushed the feature/type-handler-clean branch from e525800 to 987b6f3 Compare January 28, 2026 04:32

@jdesrosiers jdesrosiers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jdesrosiers
jdesrosiers merged commit d5b613f into hyperjump-io:main Jan 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine type error messages

2 participants