Skip to content

Enhance platformAPI documentation to reflect changes in resource handling and request structures#2436

Merged
renuka-fernando merged 3 commits into
wso2:mainfrom
Thushani-Jayasekera:qsg
Jul 6, 2026
Merged

Enhance platformAPI documentation to reflect changes in resource handling and request structures#2436
renuka-fernando merged 3 commits into
wso2:mainfrom
Thushani-Jayasekera:qsg

Conversation

@Thushani-Jayasekera

Copy link
Copy Markdown
Contributor

Update organization, project, and gateway management sections to clarify the use of handles instead of UUIDs, and improve examples for API creation and deployment processes. Adjust WebSocket event descriptions to differentiate between internal UUIDs and handle-based identifiers.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates the platform-api documentation to use handle-based resource identifiers, revised gateway and deployment request/response shapes, updated REST API lifecycle contracts, and refreshed websocket event schemas and configuration examples.

Changes

Handle-based API documentation

Layer / File(s) Summary
README workflow updates
platform-api/README.md
The quick-start flow now uses id/displayName handles, handle-based gateway token paths, handle-based API creation and deployment examples, and clarifies when WebSocket payloads use internal UUIDs.
Organization, project, and API lifecycle docs
platform-api/spec/impls/organization-management.md, platform-api/spec/impls/project-management.md, platform-api/spec/impls/api-lifecycle-management.md
Organization and project endpoints now document handle-based lookup and JWT-derived scoping, and the API lifecycle spec updates create, update, list, deployment, and gateways verification examples to match the revised contracts.

Gateway management docs

Layer / File(s) Summary
Gateway overview and registration
platform-api/spec/impls/gateway-management/gateway-management.md
Gateway endpoint documentation, registration semantics, deletion lookup, and the embedded handler example now describe handle-based routes, required endpoints, and implemented token revocation.
Gateway schema and lifecycle details
platform-api/spec/impls/gateway-management/gateway-management.md
The gateway data model and lifecycle notes now use handle, gateway_endpoints, updated uniqueness constraints, token error cases, and unconditional delete behavior.
Gateway verification and tests
platform-api/spec/impls/gateway-management/gateway-management.md
Registration, listing, token rotation/revocation, duplicate prevention, and max-token verification examples now use handle-based paths and the revised request/response payloads.

Websocket event docs

Layer / File(s) Summary
Websocket connection and configuration
platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
Connection establishment, configuration loading, environment variables, and run instructions now reflect token verification, koanf-based config, and updated connection limits.
Websocket event schema and examples
platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
Event payload examples, Go struct definitions, and manual verification output now use internal UUID fields, json.RawMessage payloads, and time.Time timestamps.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • wso2/api-platform#2367: Gateway registration and response contracts also switch from vhost to endpoints.
  • wso2/api-platform#2392: Same vhost to endpoints migration for gateway-facing API/client behavior.
  • wso2/api-platform#2413: Resolves gateway handles to internal UUIDs for deployment-related logic, matching the identifier split documented here.

Suggested reviewers: RakhithaRR, Tharsanan1, VirajSalaka, renuka-fernando, tharindu1st, malinthaprasan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is far too brief and misses the required template sections like Purpose, Goals, Approach, tests, security, and environment. Expand the PR description to fill each template section, including purpose, goals, approach, user stories, docs, tests, security checks, samples, related PRs, and test environment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: documentation updates for handle-based identifiers and request structure changes.
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 unit tests (beta)
  • Create PR with unit tests

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
platform-api/spec/impls/gateway-management/gateway-management.md (1)

563-569: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Rename the conflict text to use handles.

The error list still says “duplicate gateway name,” but this document now treats the gateway id as the handle. Update the message to “duplicate gateway handle” so it matches the rest of the contract.

Suggested edit
- **409 Conflict**: Duplicate gateway name within organization
+ **409 Conflict**: Duplicate gateway handle within organization
🤖 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 `@platform-api/spec/impls/gateway-management/gateway-management.md` around
lines 563 - 569, The Error Responses section still refers to “duplicate gateway
name,” but the contract now uses the gateway id as the handle. Update the 409
Conflict description in the gateway-management spec to say “duplicate gateway
handle” so it matches the terminology used elsewhere in the document.
🤖 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 `@platform-api/spec/impls/gateway-management/gateway-management.md`:
- Around line 68-83: Update the gateway registration/token flow wording in the
gateway-management spec so it is internally consistent: the registration step
described near the gateway creation bullets should match the later token
lifecycle rules and the note about POST /gateways/{gatewayId}/tokens. Remove or
rewrite any line that says registration generates a token if registration does
not return one, and align the surrounding Request Fields/Uniqueness text with
the chosen flow using the gateway registration and token endpoint terminology.

---

Outside diff comments:
In `@platform-api/spec/impls/gateway-management/gateway-management.md`:
- Around line 563-569: The Error Responses section still refers to “duplicate
gateway name,” but the contract now uses the gateway id as the handle. Update
the 409 Conflict description in the gateway-management spec to say “duplicate
gateway handle” so it matches the terminology used elsewhere in the document.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 116ce215-471a-449d-8a48-1ac0ec59b4cd

📥 Commits

Reviewing files that changed from the base of the PR and between 92bd23f and 5696da2.

📒 Files selected for processing (6)
  • platform-api/README.md
  • platform-api/spec/impls/api-lifecycle-management.md
  • platform-api/spec/impls/gateway-management/gateway-management.md
  • platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
  • platform-api/spec/impls/organization-management.md
  • platform-api/spec/impls/project-management.md

Comment thread platform-api/spec/impls/gateway-management/gateway-management.md
Thushani-Jayasekera and others added 2 commits July 6, 2026 10:01
…ng that the registration does not generate or return a token, and that a separate call is required to obtain one.
@renuka-fernando renuka-fernando merged commit 9d300d9 into wso2:main Jul 6, 2026
7 of 8 checks passed

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
platform-api/spec/impls/api-lifecycle-management.md (1)

25-30: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the entry-point summary with the list route.
/api/v0.9/projects/:projectId/apis is stale here; the handler/OpenAPI use /api/v0.9/rest-apis?projectId=..., which matches the verification example below. Update line 5 so readers don’t test the wrong path.

🤖 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 `@platform-api/spec/impls/api-lifecycle-management.md` around lines 25 - 30,
The entry-point summary is stale and references the wrong list route for REST
APIs. Update the API lifecycle management verification notes to match the actual
list endpoint used by the handler/OpenAPI, and keep the example consistent with
the `/api/v0.9/rest-apis?projectId=...` query pattern shown below so readers
don’t validate against the deprecated `/api/v0.9/projects/:projectId/apis` path.
🤖 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.

Outside diff comments:
In `@platform-api/spec/impls/api-lifecycle-management.md`:
- Around line 25-30: The entry-point summary is stale and references the wrong
list route for REST APIs. Update the API lifecycle management verification notes
to match the actual list endpoint used by the handler/OpenAPI, and keep the
example consistent with the `/api/v0.9/rest-apis?projectId=...` query pattern
shown below so readers don’t validate against the deprecated
`/api/v0.9/projects/:projectId/apis` path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e83bf1c9-e3d8-4ae6-aeaa-b9484db0ef2c

📥 Commits

Reviewing files that changed from the base of the PR and between 6ec0682 and d187166.

📒 Files selected for processing (4)
  • platform-api/README.md
  • platform-api/spec/impls/api-lifecycle-management.md
  • platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md
  • platform-api/spec/impls/organization-management.md
✅ Files skipped from review due to trivial changes (1)
  • platform-api/README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • platform-api/spec/impls/organization-management.md
  • platform-api/spec/impls/gateway-websocket-events/gateway-websocket-events.md

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