Skip to content

Improve reference docs for setBody#3036

Merged
rrayst merged 1 commit into
masterfrom
docs/setBody-interceptor
Jul 4, 2026
Merged

Improve reference docs for setBody#3036
rrayst merged 1 commit into
masterfrom
docs/setBody-interceptor

Conversation

@predic8

@predic8 predic8 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • SetBodyInterceptor: add @topic, rewrite @description (static string vs computed expression, supported languages, comparison to template for loops/conditionals, tutorial link); add @yaml showing a 3-line block scalar SpEL template; replace @param-based setValue doc (silently dropped by renderer) with @description/@example; expand setContentType to document JSON auto-escaping and the no-escaping-when-omitted security implication
  • AbstractLanguageInterceptor: same corrections as Improve reference docs for setHeader, AbstractSetterInterceptor, AbstractLanguageInterceptor #3035 — fix copy-pasted @description on setLanguage, add @description to setXmlConfig (trivial conflict on merge)

Test plan

  • mvn -q -o -pl core compile passes (verified locally)
  • @yaml block scalar example is valid YAML
  • Confirm tutorial at distribution/tutorials/getting-started/65-SetBody.yaml matches the documented behaviour

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified language-related guidance for setting evaluated values, including updated examples and wording.
    • Expanded usage notes for body-setting behavior, supported template languages, UTF-8 handling, and content type behavior.
    • Improved guidance around automatic escaping for JSON content types and what happens when content type is not provided.

- SetBodyInterceptor: add @topic, rewrite @description (trim attribute-level
  prose, mention template alternative, add tutorial link), add @yaml with a
  3-line block scalar value example; rewrite setValue setter doc replacing the
  dropped @param with @description/@example; expand setContentType to document
  the JSON auto-escaping behaviour and the no-escaping-when-omitted consequence
- AbstractLanguageInterceptor: fix @description on setLanguage (copy-paste from
  <if>); replace @param on setXmlConfig with @description (mirrors setHeader PR)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ca0df0e8-6364-4a9b-b667-fabe94c2673d

📥 Commits

Reviewing files that changed from the base of the PR and between b71f1fc and ba6ca06.

📒 Files selected for processing (2)
  • core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractLanguageInterceptor.java
  • core/src/main/java/com/predic8/membrane/core/interceptor/lang/SetBodyInterceptor.java

📝 Walkthrough

Walkthrough

This PR updates Javadoc comments only in AbstractLanguageInterceptor and SetBodyInterceptor, clarifying descriptions of the setLanguage method, supported template languages, UTF-8 encoding behavior, and content-type handling. No method signatures, logic, or public API declarations were changed.

Changes

Interceptor Documentation Updates

Layer / File(s) Summary
setLanguage Javadoc clarification
core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractLanguageInterceptor.java
Updated Javadoc for setLanguage(Language language) to describe it as the scripting language used to evaluate value expressions, with reformatted @example text.
SetBodyInterceptor documentation rewrite
core/src/main/java/com/predic8/membrane/core/interceptor/lang/SetBodyInterceptor.java
Rewrote class-level, setBody/value, and contentType Javadoc blocks to document supported languages (SpEL, Groovy, JsonPath, XPath), UTF-8 encoding of results, and content-type/escaping behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • membrane/api-gateway#2745: Both PRs update only Javadoc for SetBodyInterceptor.java without runtime logic changes.
  • membrane/api-gateway#2172: Both PRs make Javadoc-only updates to setLanguage(Language) docs shifting wording toward SpEL-centric behavior.
  • membrane/api-gateway#1935: Overlaps on the setLanguage API in AbstractLanguageInterceptor, though that PR changes underlying type handling rather than just docs.

Suggested reviewers: rrayst

Poem

A rabbit hopped through docs so neat,
Fixing words to make them sweet,
SpEL and Groovy, JSON too,
UTF-8 encoded, tried and true,
No code was touched, just clearer speech —
Hop, hop, hooray, good docs for each! 🐇📝

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: improving reference documentation for setBody and related language interceptor methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/setBody-interceptor

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.

@rrayst

rrayst commented Jul 4, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@rrayst rrayst merged commit f21bda4 into master Jul 4, 2026
5 checks passed
@rrayst rrayst deleted the docs/setBody-interceptor branch July 4, 2026 13:14
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