Skip to content

Improve reference docs for setHeader, AbstractSetterInterceptor, AbstractLanguageInterceptor#3035

Open
predic8 wants to merge 2 commits into
masterfrom
docs/setHeader-interceptor
Open

Improve reference docs for setHeader, AbstractSetterInterceptor, AbstractLanguageInterceptor#3035
predic8 wants to merge 2 commits into
masterfrom
docs/setHeader-interceptor

Conversation

@predic8

@predic8 predic8 commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • SetHeaderInterceptor: add @topic, rewrite @description (constant vs computed value, supported languages, tutorial link), fix @yaml to use the proper api:/flow: context and show both a static (Membrane) and a computed (${method}) example side by side
  • AbstractSetterInterceptor: add @description/@default/@example to all four @MCAttribute setters (name, value, ifAbsent, failOnError); replace the @param-based Javadoc on failOnError that was silently dropped by the renderer
  • AbstractLanguageInterceptor: fix @description on setLanguage (was a copy-paste from <if> that said "test condition"); replace @param comment on setXmlConfig with a proper @description tag (previously invisible to the renderer)

Test plan

  • mvn -q -o -pl core compile passes with no warnings (verified locally)
  • Check generated docs.yaml via MEMBRANE_GENERATE_DOC_DIR=/tmp/docs mvn -q -o -pl core compile — all four attributes of setHeader should have non-empty descriptions
  • Confirm the @yaml example matches the tutorial at distribution/tutorials/getting-started/60-SetHeader.yaml

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Improved public API documentation for language configuration, setter-related options, and header-setting behavior.
    • Added clearer Javadoc descriptions, including updated default values and examples for expression languages and configurable properties.
    • Expanded header-setting semantics with a refreshed YAML example, and clarified how expression evaluation failures are handled (abort vs. log-and-continue).

- SetHeaderInterceptor: add @topic, rewrite @description (constant vs computed,
  supported languages, tutorial link), fix @yaml to use api:/flow: context and
  show both a static and a computed (${method}) example
- AbstractSetterInterceptor: add @description/@default/@example to all four
  @MCAttribute setters (name, value, ifAbsent, failOnError); replace the
  @param-based Javadoc on failOnError that was silently dropped by the renderer
- AbstractLanguageInterceptor: fix @description on setLanguage (was a copy-paste
  from <if>); replace @param comment on setXmlConfig with @description

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: 4e9ab3a2-70bf-42b1-95d5-c9f2bcc24b4f

📥 Commits

Reviewing files that changed from the base of the PR and between 110d4e5 and d114195.

📒 Files selected for processing (1)
  • core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractSetterInterceptor.java
✅ Files skipped from review due to trivial changes (1)
  • core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractSetterInterceptor.java

📝 Walkthrough

Walkthrough

This PR updates Javadoc across three interceptor classes: AbstractLanguageInterceptor, AbstractSetterInterceptor, and SetHeaderInterceptor. It adds or revises setter and class-level documentation with clearer descriptions, defaults, and examples. No runtime logic changes.

Changes

Interceptor documentation updates

Layer / File(s) Summary
Language setter documentation
core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractLanguageInterceptor.java
Javadoc for setLanguage now describes the scripting language used to evaluate a value expression.
Setter property documentation
core/src/main/java/com/predic8/membrane/core/interceptor/lang/AbstractSetterInterceptor.java
Import cleanup switches wildcard imports to explicit imports, and Javadoc is added or revised for ifAbsent, fieldName, value, and failOnError setters.
SetHeaderInterceptor documentation
core/src/main/java/com/predic8/membrane/core/interceptor/lang/SetHeaderInterceptor.java
Class-level Javadoc expands the header-setting description, supported expression language notes, and YAML example.

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

Possibly related PRs

  • membrane/api-gateway#1935: Updates the setLanguage(Language) documentation to match the enum-based language usage introduced there.

Suggested reviewers: rrayst

Poem

A rabbit hopps through docs so bright,
With defaults, examples, and words just right.
No code to chase, no logic to mend,
Just clearer notes from start to end.
🐇📘

🚥 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 accurately summarizes the main change: documentation updates for setHeader, AbstractSetterInterceptor, and AbstractLanguageInterceptor.
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/setHeader-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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/main/java/com/predic8/membrane/core/interceptor/lang/AbstractSetterInterceptor.java`:
- Around line 133-137: Update the failOnError documentation in
AbstractSetterInterceptor so it applies to both request and response handling,
since handleResponse() uses the same path as request processing. Widen the
wording from “the request continues unchanged” to “the flow/message continues
unchanged” while keeping the existing behavior and references to failOnError,
handleResponse(), and the expression evaluation error handling consistent.
🪄 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: 9f9c7854-9562-4714-8f61-4344fc50d002

📥 Commits

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

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

@predic8 predic8 mentioned this pull request Jul 3, 2026
3 tasks
@rrayst

rrayst commented Jul 4, 2026

Copy link
Copy Markdown
Member

/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.

2 participants