Skip to content

docs: update Admin API OpenAPI reference to align with the latest development - #603

Merged
kayx23 merged 13 commits into
mainfrom
codex/admin-api-openapi-completeness
Jun 15, 2026
Merged

docs: update Admin API OpenAPI reference to align with the latest development#603
kayx23 merged 13 commits into
mainfrom
codex/admin-api-openapi-completeness

Conversation

@kayx23

@kayx23 kayx23 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expand the Admin API OpenAPI document into a reference-quality spec with operation tags, endpoint descriptions, parameter descriptions/examples, request-body descriptions, response schemas, and enum metadata
  • remove the stale /metrics path from the Admin API spec because metrics are served from the dedicated metrics listener
  • document Admin API behavior for CRUD resources, health, runtime status, delete, API key rotation, malformed JSON/content-type failures, JSON body-limit failures, and playground proxy responses
  • use the self-hosted Admin API key request schema for API key create/update routes and keep public provider-key wording on the self-hosted path
  • add OpenAPI tests for exact route coverage, response schemas, auth/error envelopes, request-body schemas, reference metadata, parameter metadata, enum metadata, JSON body-limit responses, playground media/status coverage, and internal $ref resolution

Fixes #602.

Validation

  • cargo fmt --all -- --check
  • cargo test -p aisix-admin openapi -- --nocapture
  • cargo test -p aisix-admin -- --nocapture
  • cargo run -p aisix-core --bin dump-schema
  • strict JSON metadata audit for operation tags/descriptions, parameter descriptions/examples, request-body descriptions, and enum metadata
  • internal $ref resolution audit
  • git diff --check

Docs sync

The public docs sync is in api7/docs#1680. Merge this source PR first, then merge the docs PR after required docs review approval.

Independent audit

A fresh audit agent reviewed this PR and the docs sync PR. It reported three MEDIUM findings, which were fixed in follow-up commit 62207ee. Later review passes also addressed playground response coverage, Admin JSON body-limit documentation, reference metadata completeness, self-hosted wording, and public docs $ref resolution.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kayx23, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 8 minutes and 13 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: f876e2bb-17ba-4374-879f-7f2a27ed5149

📥 Commits

Reviewing files that changed from the base of the PR and between bac213c and 4ee16ac.

📒 Files selected for processing (3)
  • crates/aisix-admin/src/openapi.rs
  • crates/aisix-core/src/models/provider_key.rs
  • schemas/resources/provider_key.schema.json
📝 Walkthrough

Walkthrough

Expands the embedded OpenAPI document in openapi.rs to declare full responses[*].content media-type schemas for all admin and playground endpoints, tightens components.schemas entries with required fields, enums, and additionalProperties constraints, and adds four new test assertions validating path completeness, schema references, response coverage, and 401 error schema consistency.

Changes

OpenAPI Spec Expansion and Validation

Layer / File(s) Summary
Info description and utility endpoint schemas
crates/aisix-admin/src/openapi.rs
Updates info.description wording for managed-mode behavior, expands /livez query parameter schema to explicit object form, and adds content blocks with media-type schemas for /admin/openapi.json and /admin/openapi-scalar responses.
Admin v1 and playground route response schemas
crates/aisix-admin/src/openapi.rs
Replaces compact response declarations across all /admin/v1/* CRUD/status endpoints and /playground/chat/completions with detailed content blocks containing JSON schemas for success payloads (ModelEntry, PublicApiKeyEntry, DeleteResponse, etc.) and all error statuses (AdminError, 401/422).
components.schemas definitions
crates/aisix-admin/src/openapi.rs
Expands schema definitions for ModelEntry, ModelStatusView, ModelKind, RuntimeStatus, SystemTime, PublicApiKey, PublicApiKeyEntry, ApiKeyRotateResponse, DeleteResponse, HealthResponse, ApiKeyRequest, and AdminError with explicit required arrays, enum values, property shapes, additionalProperties, and descriptions.
Test coverage expansion
crates/aisix-admin/src/openapi.rs
Extends schema existence assertions for newly introduced wrapper schemas; adds tests for exact admin path-set equality, ApiKeyRequest $ref usage in POST/PUT, every response defining a media schema, response media types/schemas for /playground/chat/completions, and all /admin/v1/* 401 responses referencing AdminError.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

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

@kayx23
kayx23 marked this pull request as ready for review June 15, 2026 01:18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 330def89c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/aisix-admin/src/openapi.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52cce94ef3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/aisix-admin/src/openapi.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bac213c495

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/aisix-admin/src/openapi.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1567211eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/aisix-admin/src/openapi.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ea6271ac0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/aisix-admin/src/openapi.rs
@kayx23 kayx23 changed the title docs: complete admin OpenAPI response schemas docs: polish Admin API OpenAPI reference Jun 15, 2026
@kayx23 kayx23 changed the title docs: polish Admin API OpenAPI reference docs: update Admin API OpenAPI reference to align with the latest code Jun 15, 2026
@kayx23 kayx23 changed the title docs: update Admin API OpenAPI reference to align with the latest code docs: update Admin API OpenAPI reference to align with the latest development Jun 15, 2026
@kayx23
kayx23 merged commit 9bd1e55 into main Jun 15, 2026
10 checks passed
@kayx23
kayx23 deleted the codex/admin-api-openapi-completeness branch June 15, 2026 04:40
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.

Improve Admin API OpenAPI reference completeness

1 participant