Skip to content

chore(api): hide duplicate /admin/accounts route from OpenAPI#4252

Merged
bekossy merged 1 commit intorelease/v0.98.1from
fix/api/admin-accounts-openapi
May 5, 2026
Merged

chore(api): hide duplicate /admin/accounts route from OpenAPI#4252
bekossy merged 1 commit intorelease/v0.98.1from
fix/api/admin-accounts-openapi

Conversation

@mmabrouk
Copy link
Copy Markdown
Member

@mmabrouk mmabrouk commented May 4, 2026

Summary

The legacy admin_router.create_accounts endpoint
(api/oss/src/routers/admin_router.py) and the new
fastapi/accounts/router.create_accounts both surface in the OpenAPI
schema. Fern's TypeScript codegen collapses both to the same method
name (createAccounts), forcing downstream Fern post-processors to
disambiguate via a manual rename pass.

This excludes the legacy admin route from the schema with
include_in_schema=False, removing the collision at the source.

Why

This is a prerequisite for cleaner Fern client generation (see the
feat/sdk/typescript-fern-client PR, which currently carries a Python
post-processor in clients/scripts/generate.sh to rename the duplicate
method). With this fix in place, the post-processor can eventually be
removed.

Diff

  • 1 file changed: api/oss/src/routers/admin_router.py (1 insertion)

Risks

  • Backwards compatibility: include_in_schema=False only hides the
    route from the OpenAPI schema and any auto-generated docs/clients. The
    HTTP endpoint itself (POST /admin/accounts) continues to work
    unchanged. Anyone calling it directly via HTTP is unaffected.
  • The route is admin-only and unauthenticated callers are already
    rejected — exposure surface does not change.

QA

  • CI green
  • Hit POST /admin/accounts directly (curl or Postman) — should
    return the same response as before
  • Regenerate the Fern Python client locally (clients/scripts/generate.sh)
    and verify only one createAccounts method appears in the
    generated TS admin client
  • Confirm the admin_create_accounts operation in the new
    fastapi/accounts/router is still in the OpenAPI schema (it is
    the canonical one going forward)

The legacy admin_router.create_accounts endpoint and the new
fastapi/accounts/router.create_accounts both emit operation IDs that
generate the same TypeScript method name in Fern client codegen.
Excluding the legacy route from the OpenAPI schema removes the
collision at the source, eliminating the need for downstream Fern
post-processors to disambiguate the generated method.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment May 4, 2026 10:54am

Request Review

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 4, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 277acfe9-4d77-4faa-b65a-4b8af2886f13

📥 Commits

Reviewing files that changed from the base of the PR and between c63d6e9 and ecd5853.

📒 Files selected for processing (1)
  • api/oss/src/routers/admin_router.py

📝 Walkthrough

Summary by CodeRabbit

Release Notes

No user-visible changes in this release. This update makes internal adjustments to API documentation generation.

Walkthrough

The /accounts POST endpoint in the admin router is updated to exclude itself from OpenAPI schema generation by adding include_in_schema=False to the route decorator. No function logic or behavior is modified.

Changes

OpenAPI Schema Exclusion

Layer / File(s) Summary
Route Configuration
api/oss/src/routers/admin_router.py
The @router.post(...) decorator for create_accounts now includes include_in_schema=False, preventing the endpoint from appearing in generated OpenAPI documentation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: hiding a duplicate admin route from OpenAPI by using the include_in_schema=False decorator.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, explaining the duplicate route problem, the solution implemented, and the rationale behind the change.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/api/admin-accounts-openapi

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@dosubot dosubot Bot added the refactoring A code change that neither fixes a bug nor adds a feature label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-05-05T08:36:31.807Z

@bekossy bekossy changed the base branch from main to release/v0.98.1 May 5, 2026 08:29
@bekossy bekossy requested a review from jp-agenta May 5, 2026 08:29
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 5, 2026
@bekossy bekossy merged commit 14d6f85 into release/v0.98.1 May 5, 2026
31 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactoring A code change that neither fixes a bug nor adds a feature size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants