Skip to content

Conversation

@Oshanath
Copy link
Contributor

@Oshanath Oshanath commented Nov 24, 2025

Related issue: wso2/api-manager#4563

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed XML well-formedness issue in SOAP-to-REST payload transformations. Closing tags in generated payloads now correctly correspond to their opening element names, resolving mismatched XML tag pairs that could cause validation errors and downstream processing failures.

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

The closing XML tag in SOAP-to-REST payload construction is changed from a static </web:string> to a dynamic </web:${element.paramName}> across four repository modules, ensuring proper XML element matching and well-formedness for parameterized elements.

Changes

Cohort / File(s) Summary
SOAP-to-REST Sequence Template XML Fix
all-in-one-apim/modules/.../api_templates/soap_to_rest_in_seq_template.xml, api-control-plane/modules/.../api_templates/soap_to_rest_in_seq_template.xml, gateway/modules/.../api_templates/soap_to_rest_in_seq_template.xml, traffic-manager/modules/.../api_templates/soap_to_rest_in_seq_template.xml
Closing XML tag adjusted from static </web:string> to dynamic </web:${element.paramName}> to match parameterized opening tag, ensuring proper XML well-formedness. No control flow or logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • All four files contain identical changes with no logic alterations, reducing cognitive load
  • Changes are purely syntactic (XML tag correction) with no functional impact
  • Homogeneous fix applied uniformly across modules makes verification straightforward

Poem

🐰 Four XML tags dance in the breeze,
From static strings to dynamic ease,
Each element now has its proper name,
Well-formed and matched, no longer shame!
A rabbit's hop toward wholeness complete! 🌟

Pre-merge checks and finishing touches

✅ 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: making opening and closing XML tags match in the SOAP-to-REST template by changing static closing tags to dynamic ones.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
all-in-one-apim/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1)

18-18: Minor: Loop variable should be declared with var.

For better JavaScript practice, declare the loop variable explicitly:

-      for (i = 0; i &lt; results.length; i++) {
+      for (var i = 0; i &lt; results.length; i++) {

This prevents unintentional global variable creation. (This may be pre-existing code, so feel free to defer if addressing in a separate pass.)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8cd618c and 00ef7ae.

📒 Files selected for processing (4)
  • all-in-one-apim/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1 hunks)
  • api-control-plane/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1 hunks)
  • gateway/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1 hunks)
  • traffic-manager/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1 hunks)
🔇 Additional comments (4)
gateway/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1)

20-20: Good catch—dynamic closing tag now matches the opening tag.

This change fixes a critical XML well-formedness issue. The opening tag uses ${element.paramName}, and the closing tag now correctly uses the same variable, ensuring proper matching. Previously, the static </web:string> closing tag would create malformed XML when the element name didn't match.

Please verify the following to confirm the fix is complete:

  1. Validate paramName characters: Ensure element.paramName is always sanitized to contain only valid XML element name characters (no spaces, special characters, etc.).
  2. Integration testing: Confirm that existing integration tests pass with this change, particularly for SOAP-to-REST transformations with diverse element types.

Would you like me to generate a script to search the codebase for how element.paramName is assigned/populated, to verify it's always safe for use in XML element names?

all-in-one-apim/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1)

20-20: XML tag closure now matches dynamic opening tag.

The change correctly addresses the PR objective by making the closing tag </web:${element.paramName}> correspond dynamically to the opening tag <web:${element.paramName} ...>. This ensures well-formed XML output regardless of which element is being serialized, fixing the previous issue where a static </web:string> would not match opening tags with different paramNames.

The XML escaping (&lt; and &gt;) is correct.

api-control-plane/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1)

20-20: Fix verified and applied consistently across all SOAP-to-REST templates.

Verification confirms that the XML closing tag correction has been successfully applied across all four related modules:

  • all-in-one-apim/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml
  • api-control-plane/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml
  • gateway/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml
  • traffic-manager/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml

All files now properly generate matching opening and closing tags with dynamic parameter names, ensuring valid XML output regardless of the element name.

traffic-manager/modules/distribution/resources/api_templates/soap_to_rest_in_seq_template.xml (1)

20-20: Fix XML well-formedness by matching dynamic opening and closing tags.

The opening tag <web:${element.paramName}> is parameterized, but the closing tag was previously hardcoded as </web:string>, producing malformed XML when the element name differed from string. The fix correctly makes the closing tag dynamic to match the opening tag.

Verification confirms this fix is consistently applied across all related modules: traffic-manager, gateway, api-control-plane, and all-in-one-apim.

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 8.58%. Comparing base (6cc02f3) to head (00ef7ae).
⚠️ Report is 51 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13928      +/-   ##
============================================
- Coverage     11.77%    8.58%   -3.20%     
+ Complexity      784      616     -168     
============================================
  Files           335      335              
  Lines         16537    16537              
  Branches       1783     1783              
============================================
- Hits           1948     1419     -529     
- Misses        14558    15098     +540     
+ Partials         31       20      -11     
Flag Coverage Δ
integration_tests 8.58% <ø> (-3.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oshanath Oshanath merged commit 359a8ab into wso2:master Nov 25, 2025
9 of 10 checks 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.

2 participants