-
-
Notifications
You must be signed in to change notification settings - Fork 696
Allow empty payloads in test runs #1962
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
Allow empty payloads in test runs #1962
Conversation
|
WalkthroughThe changes introduce configurable linting behavior to the JSONEditor component, allowing users to enable or disable linting and to specify whether empty content should be considered valid. Supporting logic was added to handle linting based on these new props. Editor theme styles were updated to improve the appearance of linting diagnostics. The default editor setup was simplified by removing built-in linting extensions, delegating linting responsibility to the JSONEditor component. Additionally, JSON parsing and validation logic was improved in the test task schema for clearer error reporting, and a placeholder attribute was removed from a JSONEditor instance. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant JSONEditor
participant CodeMirror
participant Linter
User->>JSONEditor: Edit JSON content
JSONEditor->>CodeMirror: Update editor state
alt Linting enabled
JSONEditor->>Linter: Run linter (empty-aware if allowEmpty)
Linter-->>JSONEditor: Return diagnostics (or none if empty)
JSONEditor->>CodeMirror: Display diagnostics with custom styling
else Linting disabled
JSONEditor->>CodeMirror: No diagnostics shown
end
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (13)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
.optional() | ||
.transform((val, ctx) => { | ||
if (!val) { | ||
return {}; |
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.
Returning undefined
here would be more fitting, but it breaks the replay flow, which doesn't handle this well. The fix seemed a bit involved, so leaving this for a separate PR. In the meantime, the behavior stays the same, as users would still pass { }
as empty payload for tests.
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.
Good idea
Changes in this PR:
Screenshots
Previously:

Now:

Summary by CodeRabbit
New Features
Style
Bug Fixes
Chores