Skip to content

docs(openapi): polish Admin API schema descriptions - #741

Merged
kayx23 merged 2 commits into
mainfrom
docs/mcp-apikey-openapi-polish
Jul 8, 2026
Merged

docs(openapi): polish Admin API schema descriptions#741
kayx23 merged 2 commits into
mainfrom
docs/mcp-apikey-openapi-polish

Conversation

@kayx23

@kayx23 kayx23 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • clarify that omitted, null, or empty allowed_tools all grant no MCP tool access
  • update stale guardrail enforcement_mode wording now that monitor mode records matches without blocking or redacting
  • remove implementation-oriented wording from public schema descriptions for guardrails, semantic routing, ensemble weight, and model status entries
  • regenerate affected resource schema files

Validation

  • cargo fmt
  • cargo run -p aisix-core --bin dump-schema
  • cargo run -p aisix-admin --bin dump-openapi
  • cargo test -p aisix-admin openapi
  • cargo test -p aisix-core --test resource_schema_characterization
  • cargo test -p aisix-core --test model_schema_characterization
  • git diff --check

Summary by CodeRabbit

  • Documentation
    • Clarified API key, guardrail, semantic routing, and ensemble schema descriptions for more accurate user-facing guidance.
    • Updated wording around MCP tool access to explicitly note that omitted, null, or empty lists grant no tool access.
    • Refined guardrail and semantic route descriptions to better explain current behavior, defaults, and supported fallback options.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6630e636-e7af-40fb-9a99-49f4376bb9bc

📥 Commits

Reviewing files that changed from the base of the PR and between 9fcb09f and a2abd6d.

📒 Files selected for processing (2)
  • crates/aisix-core/src/models/guardrail.rs
  • schemas/resources/guardrail.schema.json
📝 Walkthrough

Walkthrough

This PR updates description text in Rust doc comments, OpenAPI-generated schema strings, and JSON schema files across API key, guardrail, ensemble, and semantic route resources, clarifying behavior semantics (e.g., empty-list handling, ignored fields, fallback forms). Corresponding OpenAPI test assertions are updated to match. No structural, logic, or type changes are made.

Changes

Documentation and schema description updates

Layer / File(s) Summary
API key allowed_tools empty-list clarification
crates/aisix-core/src/models/apikey.rs, crates/aisix-admin/src/openapi.rs, schemas/resources/api_key.schema.json
Doc comments, OpenAPI schema descriptions, and the JSON schema for allowed_tools now explicitly state that an empty list (in addition to omitted/null) denies MCP tool access; related OpenAPI tests assert the updated wording.
Guardrail field documentation rewording
crates/aisix-core/src/models/guardrail.rs, schemas/resources/guardrail.schema.json, schemas/resources/guardrail_attachment.schema.json
Descriptions for PII detector/regex config, OpenAI moderation endpoint/thresholds, enforcement_mode, mandatory, direction, GuardrailScopeType, and GuardrailAttachment.enabled are reworded to reflect current AISIX terminology and behavior.
Ensemble and semantic route documentation rewording
crates/aisix-core/src/models/ensemble.rs, crates/aisix-core/src/models/semantic.rs, crates/aisix-admin/src/openapi.rs, schemas/resources/ensemble.schema.json, schemas/resources/semantic.schema.json, schemas/resources/model.schema.json
Descriptions for PanelMember.weight, SemanticRoute.examples/threshold, OnEmbeddingFailure fallback modes, and ModelStatusView.kind are reworded for clarity and consistency across code docs and schemas.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • api7/aisix#677: Both PRs update the same allowed_tools OpenAPI/JSON-schema documentation for API keys, refining MCP tool access semantics.
  • api7/aisix#683: Both PRs touch crates/aisix-core/src/models/guardrail.rs documentation around mandatory/enforcement_mode semantics.
  • api7/aisix#709: Both PRs touch allowed_tools semantics in the API key OpenAPI/JSON schema and crates/aisix-core/src/models/apikey.rs docs.
🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
E2e Test Quality Review ⚠️ Warning The added coverage is schema snapshot/characterization tests only (merged_openapi() JSON assertions and validator corpora); no API→service→DB/external end-to-end flow is exercised. Add an integration/E2E test that drives the Admin API through the real request path and verifies the generated schema/behavior, keeping the snapshot tests as secondary coverage.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the documentation-focused OpenAPI schema description updates.
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.
Security Check ✅ Passed Documentation-only schema/OpenAPI wording updates; no secrets, authz, persistence, TLS, or access-control logic changed.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/mcp-apikey-openapi-polish

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.

@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: 9fcb09f6cf

ℹ️ 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-core/src/models/guardrail.rs Outdated
@kayx23
kayx23 merged commit 2870fd8 into main Jul 8, 2026
12 checks passed
@kayx23
kayx23 deleted the docs/mcp-apikey-openapi-polish branch July 8, 2026 03:59
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.

1 participant