fix: sync developer portal openapi spec#12
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesDeveloper Portal OpenAPI Specification Updates
Sequence Diagram(s)sequenceDiagram
participant Client
participant PortalAPI
participant AuthMiddleware
Client->>PortalAPI: HTTP request (Authorization: Bearer <token>, X-Portal-Developer-ID: <dev-id>)
PortalAPI->>AuthMiddleware: validate Bearer token and/or DeveloperIDHeader per operation
AuthMiddleware->>PortalAPI: authentication result (allow / deny)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR synchronizes the @api7/portal-sdk OpenAPI spec (and generated SDK/types) with upstream Developer Portal corrections, aligning the TypeScript SDK surface with the API’s updated schema and request-body requirements.
Changes:
- Updates the OpenAPI spec metadata (expanded description, adds
X-Portal-Developer-IDheader auth) and marks mutatingrequestBodysections as required. - Regenerates TypeScript types to include
Developer.stateand make request bodies required for mutating operations; correctsorder_bydescriptions to referenceupdated_at. - Updates generated SDK function signatures to require
optionswhere request bodies are required, matching the regenerated types.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/portal-sdk/openapi.yaml | Syncs OpenAPI metadata/auth and enforces required request bodies; corrects order_by descriptions. |
| packages/portal-sdk/src/generated/types.gen.ts | Regenerates types to add Developer.state and require bodies for mutating operations; updates related docs. |
| packages/portal-sdk/src/generated/sdk.gen.ts | Aligns SDK method signatures with required-body operations (requires options). |
| .nx/version-plans/version-plan-1779246751432.md | Adds an Nx release plan entry for the portal-sdk package bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.nx/version-plans/version-plan-1779246751432.md:
- Line 2: The package version-plan currently lists "portal-sdk: patch" but the
generated public API changed (Developer.status → Developer.state), which is a
breaking/semver-minor change; update the version plan entry to at least
"portal-sdk: minor" (or "major" if your policy requires) so the release reflects
the public type change, and ensure the file version-plan-1779246751432.md is
updated accordingly to reference the new bump for portal-sdk and any related
notes about the Developer.status → Developer.state rename.
In `@packages/portal-sdk/openapi.yaml`:
- Line 1396: The OpenAPI parameter description for "order_by" is incorrect (it
describes sort direction instead of the sort field); update the description of
the order_by parameter in packages/portal-sdk/openapi.yaml to clearly state that
it selects which field to sort by (e.g., "Field to sort results by, such as
`created_at` or `updated_at`") and remove any mention of ascending/descending
ordering so docs generated from the "order_by" parameter are semantically
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ce257b57-4728-4f5b-94c3-61c6deb7a091
⛔ Files ignored due to path filters (2)
packages/portal-sdk/src/generated/sdk.gen.tsis excluded by!**/generated/**packages/portal-sdk/src/generated/types.gen.tsis excluded by!**/generated/**
📒 Files selected for processing (2)
.nx/version-plans/version-plan-1779246751432.mdpackages/portal-sdk/openapi.yaml
|
The inline issues are addressed: I did not add E2E tests here because this repo is the TypeScript SDK package and the change is generated from |
|
Adjusted to match the control-plane review: Revalidated locally with: |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.nx/version-plans/version-plan-1779246751432.md:
- Line 2: The version plan currently lists the entry "portal-sdk: major" but
this PR's changes are minor; update that entry to "portal-sdk: minor" so the
planned release level matches the documented contract impact—edit the line
containing the exact token "portal-sdk: major" and replace "major" with "minor".
In `@packages/portal-sdk/openapi.yaml`:
- Around line 547-548: Add the same security override used by
getPublicAccessSettings to the getSMTPServerStatus operation so it requires only
BearerAuth (not the global DeveloperIDHeader). Locate the getSMTPServerStatus
operation in the OpenAPI document and replace its inherited security
requirements with a local security block containing only "BearerAuth: []"
(mirroring getPublicAccessSettings) so both system-read endpoints have
consistent Bearer-only auth.
🪄 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: d677d88a-8445-43e0-8cc9-18fa73e7b14a
📒 Files selected for processing (2)
.nx/version-plans/version-plan-1779246751432.mdpackages/portal-sdk/openapi.yaml
|
One note on the latest CodeRabbit walkthrough: the |
This mirrors the Developer Portal OpenAPI corrections from api7/api7ee-3-control-plane#2683 into the SDK package.
The mirrored spec now removes the invalid required
Developer.statusfield without addingDeveloper.state, requires request bodies for mutating operations, documents bearer auth globally, and requiresX-Portal-Developer-IDonly for operations that need the active developer context. The500response branches are kept for compatibility with existing generated SDK error handling.The version plan is
majorbecause generated mutating operation inputs now require request bodies/options, which is a breaking TypeScript surface change for v1 consumers.Validation run locally:
Summary by CodeRabbit
New Features
Bug Fixes
Chores