-
Notifications
You must be signed in to change notification settings - Fork 46
fix(DataMapper): Avoid attaching JSON schema to the source body #2431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2431 +/- ##
==========================================
+ Coverage 81.91% 81.93% +0.01%
==========================================
Files 471 471
Lines 15008 15020 +12
Branches 3313 3318 +5
==========================================
+ Hits 12294 12306 +12
- Misses 2546 2712 +166
+ Partials 168 2 -166 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where JSON schemas could be incorrectly attached to source body documents in the DataMapper, which is not supported. The fix adds file extension validation and user feedback for unsupported file types.
- Validates file extensions before allowing schema attachment based on document type
- Shows appropriate error messages when JSON schemas are attempted on source body
- Disables the attach button when no valid files are selected
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AttachSchemaButton.tsx | Adds file extension validation and error handling to prevent JSON schema attachment to source body |
| AttachSchemaButton.test.tsx | Adds comprehensive test coverage for new validation scenarios and error cases |
packages/ui/src/components/Document/actions/AttachSchemaButton.tsx
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mean to block the PR, but perhaps we should reconsider our direction and work on easing the use of JSON schemas rather than blocking the user from adding it.
Fixes: #2429
Following up #2427 (comment)
2025-08-07.12-00-54.mp4