Skip to content

Conversation

@christiangoerdes
Copy link
Collaborator

@christiangoerdes christiangoerdes commented Jan 16, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced YAML parsing validation to properly handle null and empty documents, preventing incorrect processing of invalid input and improving overall system robustness.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

A single-line validation enhancement to GenericYamlParser that adds stricter null and empty checks for JSON document nodes during YAML parsing, preventing processing of null or effectively empty documents.

Changes

Cohort / File(s) Summary
YAML Parser Null/Empty Validation
annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java
Enhanced null/empty check condition for JSON node validation; now treats jsonNode as empty if it is null, isJsonNull, or isEmpty before skipping with EMPTY_DOCUMENT_WARNING

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • PR #2593: Refactors GenericYamlParser and its helper flows; shares the same file and YAML parsing logic modifications as this validation tightening.

Suggested reviewers

  • predic8

Poem

🐰 A null check hops in with care,
Empty nodes vanish in the air,
Validation tight, no gaps remain,
YAML parsing, cleaner strain! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding null and empty JsonNode checks during YAML parsing to enhance robustness.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d338822 and 6308a40.

📒 Files selected for processing (1)
  • annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (1)
annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java (1)

73-77: LGTM! Correctly handles JSON null nodes from YAML parsing.

The addition of jsonNode.isNull() properly catches YAML documents that parse to a NullNode (e.g., documents containing just null or ~). The condition order is correct—checking Java null first prevents NPE on subsequent method calls.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@membrane-ci-server
Copy link

This pull request needs "/ok-to-test" from an authorized committer.

@christiangoerdes
Copy link
Collaborator Author

/ok-to-test

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.

3 participants