Skip to content

Updated APIProxy JavaDocs#3074

Open
predic8 wants to merge 1 commit into
masterfrom
reference-doc-api
Open

Updated APIProxy JavaDocs#3074
predic8 wants to merge 1 commit into
masterfrom
reference-doc-api

Conversation

@predic8

@predic8 predic8 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Documentation
    • Updated API proxy documentation for clearer configuration guidance and examples.
    • Clarified how published API docs relate to request/response validation when enabled.
    • Added explanations for request-based API matching, language settings for expressions, and XML namespace configuration.
    • Improved setter and attribute descriptions for easier setup and reference.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates Javadoc documentation in APIProxy.java, rewriting the class-level description and YAML examples, clarifying the OpenAPI deployment method's validation behavior, and adding new documentation for the test, setId, setDescription, language, and xmlConfig attributes. No functional code changes.

Changes

APIProxy Javadoc updates

Layer / File(s) Summary
Class and deployment documentation
core/.../APIProxy.java
Rewrites the class-level @description and YAML examples covering OpenAPI publishing/rewriting/routing, and clarifies that publishing /api-docs also triggers request/response validation when configured.
Attribute documentation additions
core/.../APIProxy.java
Adds new Javadoc for the test attribute (per-request discrimination expression), setId/setDescription setters, the language attribute used to evaluate test, and updates the xmlConfig description for XML namespace configuration used by XPath expressions.

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

Possibly related PRs

  • membrane/api-gateway#3034: Both PRs update Javadoc/documentation in APIProxy.java, rewriting the class/method descriptions and the /api-docs/test expression YAML examples with no runtime code changes.

Suggested reviewers: rrayst

Poem

A rabbit hops through docs anew,
No code was changed, just words in view,
Javadocs polished, clean and bright,
"/api-docs" explained just right,
Hop, hop, hooray, the comments align! 🐇📝

🚥 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 and concisely summarizes the main change: APIProxy Javadoc updates.
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 reference-doc-api

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/openapi/serviceproxy/APIProxy.java`:
- Around line 52-55: Update the Javadoc summary in APIProxy so it matches the
routing behavior: clarify that OpenAPI deployments route to an explicit target
when present, and only fall back to the OpenAPI servers field if no target is
configured. Keep the existing references to openapi children and /api-docs, but
adjust the wording around the target/servers behavior so the documentation is
accurate.
🪄 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: 5bb5b108-752d-4b2b-a18d-74ee289c87ed

📥 Commits

Reviewing files that changed from the base of the PR and between d6d92d4 and da15646.

📒 Files selected for processing (1)
  • core/src/main/java/com/predic8/membrane/core/openapi/serviceproxy/APIProxy.java

Comment on lines +52 to +55
* <p>When <code>openapi</code> children are present, Membrane deploys the described API: it publishes
* the specifications at <code>/api-docs</code> and routes to the target from the OpenAPI
* <code>servers</code> field. See <code>tutorials/getting-started/80-OpenAPI.yaml</code> and
* <code>tutorials/getting-started/90-OpenAPI-Validation.yaml</code>.</p>

@coderabbitai coderabbitai Bot Jul 8, 2026

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Mention the explicit target fallback in the OpenAPI summary.

The class Javadoc says OpenAPI APIs route from the document servers field, but runtime routing prefers an explicit target element and only falls back to servers when no target is configured. Please make that caveat explicit so the docs match behavior.

Proposed wording
- * specifications at <code>/api-docs</code> and routes to the target from the OpenAPI
- * <code>servers</code> field.
+ * specifications at <code>/api-docs</code> and routes using an explicit <code>target</code>
+ * when present, otherwise the OpenAPI <code>servers</code> field.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* <p>When <code>openapi</code> children are present, Membrane deploys the described API: it publishes
* the specifications at <code>/api-docs</code> and routes to the target from the OpenAPI
* <code>servers</code> field. See <code>tutorials/getting-started/80-OpenAPI.yaml</code> and
* <code>tutorials/getting-started/90-OpenAPI-Validation.yaml</code>.</p>
* <p>When <code>openapi</code> children are present, Membrane deploys the described API: it publishes
* the specifications at <code>/api-docs</code> and routes using an explicit <code>target</code>
* when present, otherwise the OpenAPI <code>servers</code> field. See <code>tutorials/getting-started/80-OpenAPI.yaml</code> and
* <code>tutorials/getting-started/90-OpenAPI-Validation.yaml</code>.</p>
🤖 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/openapi/serviceproxy/APIProxy.java`
around lines 52 - 55, Update the Javadoc summary in APIProxy so it matches the
routing behavior: clarify that OpenAPI deployments route to an explicit target
when present, and only fall back to the OpenAPI servers field if no target is
configured. Keep the existing references to openapi children and /api-docs, but
adjust the wording around the target/servers behavior so the documentation is
accurate.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

!

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.

@rrayst Could you clarify your comment? Not sure if you meant to express agreement, disagreement, or something else regarding the suggested Javadoc wording about target vs servers fallback. Happy to adjust the wording or drop the suggestion if it doesn't apply here.

(・_・)?

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