WSDL Validator: Support for Emtpy Messages#2955
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds null-safe handling for WSDL messages with no parts, filters null parts in the extractor, updates WSDLValidator to skip empty-response bodies and branch on flow state, standardizes imports, and adds a test + WSDL fixture for empty messages. ChangesWSDL Empty Message Handling and Validator Logic
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/WSDLValidator.java (1)
104-107: 💤 Low valueConsider the log level and request handling.
Two observations:
Log level: Using
log.info()for skipping validation of empty responses might be verbose. Considerlog.debug()since this is an expected condition that doesn't require operator attention.Request handling: This early return only applies to
RESPONSEflow. Should empty request bodies also skip validation, or is this response-specific by design?The response-only handling appears intentional based on the PR scope (WSDL operations can have empty responses), but verifying the design intent would be helpful.
💡 Optional: Change to debug level
- log.info("Skipping validation of empty response."); + log.debug("Skipping validation of empty response.");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/WSDLValidator.java` around lines 104 - 107, In WSDLValidator update the log level for the empty-response early-return: in the conditional that checks (flow == Interceptor.Flow.RESPONSE && message.isBodyEmpty()) replace the use of log.info(...) with log.debug(...) so skipping validation of expected empty responses is logged at a debug level; keep the early return behavior as-is (response-only) since this PR is response-scoped but confirm separately if empty requests should also be skipped in a future change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@core/src/test/java/com/predic8/membrane/core/util/soap/WSDLParserTest.java`:
- Around line 199-217: The test emptyMessage in WSDLParserTest should verify the
new null-return behavior of Message.getPart(): after locating the Message
instance (msg) with name "CityResponse" and asserting msg.getParts().size() ==
0, add an assertion that msg.getPart() returns null (or is null) to cover the PR
change to Message.getPart(). Ensure you reference the same msg variable and keep
the check right after the existing part-size assertion.
---
Nitpick comments:
In
`@core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/WSDLValidator.java`:
- Around line 104-107: In WSDLValidator update the log level for the
empty-response early-return: in the conditional that checks (flow ==
Interceptor.Flow.RESPONSE && message.isBodyEmpty()) replace the use of
log.info(...) with log.debug(...) so skipping validation of expected empty
responses is logged at a debug level; keep the early return behavior as-is
(response-only) since this PR is response-scoped but confirm separately if empty
requests should also be skipped in a future change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f8f6c152-d840-4d4d-8913-ecd6c2b109bd
📒 Files selected for processing (6)
core/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/AbstractXMLSchemaValidator.javacore/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/WSDLMessageElementExtractor.javacore/src/main/java/com/predic8/membrane/core/interceptor/schemavalidation/WSDLValidator.javacore/src/main/java/com/predic8/membrane/core/util/wsdl/parser/Message.javacore/src/test/java/com/predic8/membrane/core/util/soap/WSDLParserTest.javacore/src/test/resources/ws/special/empty-message.wsdl
Summary by CodeRabbit
Bug Fixes
Tests