Prevent AsyncAPI definition request for API Products#1369
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesAPIProduct guard in Environments useEffect
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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
🤖 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
`@portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx`:
- Line 829: The useEffect dependency array for the effect that builds endpoint
mappings is missing `allExternalGateways`, which is a variable read within the
effect body at line 812. Add `allExternalGateways` to the dependency array
alongside api.id, api.apiType, and isMCPServer to ensure the effect re-runs
whenever external gateways are updated, preventing stale endpoint mappings.
🪄 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: 675106cb-37b6-4f5c-ae05-70ce71ea1ac3
📒 Files selected for processing (1)
portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Environments/Environments.jsx
|
Hi team, This PR is ready for review. The workflow is currently awaiting maintainer approval. Thank you. |
|
|
Updated the dependency array to include Thank you for the review. |



Fixes wso2/api-manager#5092
This PR prevents the Publisher deployment page from calling the AsyncAPI definition endpoint for API Products.
API Products do not carry AsyncAPI definitions, so calling
restApi.getAsyncAPIDefinition(api.id)for API Products creates an unnecessary failed network request.The fix adds an API Product guard while keeping the existing MCP Server guard unchanged.
Changes:
api.apiType === API.CONSTS.APIProductgetAsyncAPIDefinitionwhen the current entity is an API Productapi.apiTypeandisMCPServerTesting:
git diffEnvironments.jsxwas changed