Skip to content

docs: document pagination and search params for GET /api/governance/customers (closes #3545)#3634

Open
dungnthe130669 wants to merge 5 commits into
maximhq:devfrom
dungnthe130669:docs/governance-customers-pagination-3545
Open

docs: document pagination and search params for GET /api/governance/customers (closes #3545)#3634
dungnthe130669 wants to merge 5 commits into
maximhq:devfrom
dungnthe130669:docs/governance-customers-pagination-3545

Conversation

@dungnthe130669
Copy link
Copy Markdown

Summary

Closes #3545

GET /api/governance/customers accepts limit, offset, and search query params and returns total_count, limit, offset in responses — none of these were documented in the OpenAPI spec.

Changes

docs/openapi/openapi.json

Query params added to paths["/api/governance/customers"].get.parameters:

  • limit (integer, minimum 1) — max customers to return
  • offset (integer, minimum 0, default 0) — pagination offset
  • search (string) — filter customers by name or ID

Response fields added to components.schemas.ListCustomersResponse.properties:

  • total_count — total matching records before pagination
  • limit — echoes the request limit param
  • offset — echoes the request offset param

No logic changes — pure spec documentation fix.

…ustomers (closes maximhq#3545)

Add missing query parameters and response fields to OpenAPI spec:

Query params added:
- limit (integer, min 1) — max customers to return
- offset (integer, min 0, default 0) — pagination offset
- search (string) — filter customers by name or ID

ListCustomersResponse fields added:
- total_count — total matching records before pagination
- limit — echoes the request limit
- offset — echoes the request offset

These params are accepted and returned by the handler in
transports/bifrost-http/handlers/governance.go but were
undocumented in the OpenAPI spec.

Closes maximhq#3545
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 30751d82-c908-4446-8aff-3f5631e792e4

📥 Commits

Reviewing files that changed from the base of the PR and between 680575f and b4c3203.

📒 Files selected for processing (2)
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/governance.yaml

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Added Customers API query parameters for pagination and filtering: limit (integer, 1–100), offset (integer, >=0, default 0), and search.
    • Added pagination metadata to Customers responses: total_count, limit, and offset (now required).
    • Normalized OpenAPI text and examples for consistent punctuation and symbol rendering (dash variants, degree symbol encoding, badge glyphs) and cleaned JSON formatting.

Walkthrough

Adds documented query parameters limit, offset, and search to the Customers GET operation and extends ListCustomersResponse with total_count, limit, and offset (marked required). Also normalizes punctuation/glyphs (dash variants, degree symbol) across several OpenAPI descriptions and examples.

Changes

OpenAPI Documentation Updates

Layer / File(s) Summary
Customers API pagination and search schema
docs/openapi/paths/management/governance.yaml, docs/openapi/openapi.json, docs/openapi/schemas/management/governance.yaml
Adds query parameters limit (integer, min 1, max 100, default behavior), offset (integer, min 0, default 0), and search (string) to the Customers GET operation. Updates ListCustomersResponse to include and require total_count, limit, and offset with descriptions.
Text normalization and formatting cleanup
docs/openapi/openapi.json
Normalizes dash/glyph characters and degree-symbol encoding in multiple endpoint descriptions and example tool outputs; includes a minor end-of-file JSON formatting tweak.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
Dashes smoothed and glyphs set right,
Pages counted in the glowing light.
Params added, clients clap in tune,
Spec hops forward under the moon.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The summary mentions normalization of punctuation/glyphs (dashes, degree symbols, badges) and JSON formatting changes in openapi.json that appear unrelated to the stated pagination documentation objective. Clarify whether punctuation normalization and glyph updates are intentional scope creep or should be separated into a distinct PR focused on spec documentation fixes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: documenting pagination and search parameters for the GET /api/governance/customers endpoint.
Description check ✅ Passed The PR description provides a clear summary, explains what was changed, and documents the specific query parameters and response fields added to the OpenAPI spec.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #3545: documents limit, offset, and search query parameters, and adds total_count, limit, offset to the response schema, all marked as required.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 `@docs/openapi/openapi.json`:
- Around line 39057-39063: The OpenAPI parameter "limit" currently only
specifies type and minimum; update its schema object to include "default": 25
and "maximum": 100 so the contract documents server behavior (server default 25
and clamp at 100). Locate the "limit" parameter definition in the OpenAPI JSON
(the schema under the "name": "limit" parameter) and add the default and maximum
fields to that schema.
- Around line 61437-61448: The ListCustomersResponse schema was updated to
include total_count, limit, and offset but the schema's required array wasn't
updated; update the OpenAPI schema for ListCustomersResponse to add
"total_count", "limit", and "offset" to its required list so these fields are
marked as mandatory in the contract—locate the ListCustomersResponse object in
openapi.json and append these three property names to its required array.
🪄 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: eb8fecbc-37f2-4cd3-a986-527fc67792f6

📥 Commits

Reviewing files that changed from the base of the PR and between ddc7a3e and 72ca78e.

📒 Files selected for processing (1)
  • docs/openapi/openapi.json

Comment thread docs/openapi/openapi.json
Comment thread docs/openapi/openapi.json
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Confidence Score: 5/5

This is a docs-only change with no logic modifications; it correctly reflects the server's existing behavior and is safe to merge.

All three code paths in the Go handler consistently return the newly documented fields, making the required-field additions accurate. The parameter constraints match the server's actual clamping logic. The only remaining gap is a minor description wording issue on the response-level limit field.

The description of the limit response field in both docs/openapi/schemas/management/governance.yaml and docs/openapi/openapi.json could be more precise.

Important Files Changed

Filename Overview
docs/openapi/openapi.json Adds limit/offset/search query parameters and total_count/limit/offset response fields to GET /api/governance/customers; also converts a few em-dash HTML entities to Unicode. The response limit field description slightly overstates clamping behavior for non-paginated paths.
docs/openapi/paths/management/governance.yaml Adds limit (min 1, max 100), offset (min 0, default 0), and search query parameters to the GET /api/governance/customers operation with accurate descriptions matching server behavior.
docs/openapi/schemas/management/governance.yaml Adds total_count, limit, offset fields to ListCustomersResponse and marks them (plus the pre-existing customers and count) as required. The limit field description slightly overstates clamping behavior for non-paginated paths.

Reviews (5): Last reviewed commit: "docs: remove misleading default:25 from ..." | Re-trigger Greptile

Comment thread docs/openapi/openapi.json
Comment thread docs/openapi/openapi.json
…fields

- Sync docs/openapi/paths/management/governance.yaml with json spec:
  add limit/offset/search query params
- Sync docs/openapi/schemas/management/governance.yaml:
  add total_count/limit/offset to ListCustomersResponse with required array
- Fix limit schema: add default: 20 and maximum: 100
- Add required: [total_count, limit, offset] to ListCustomersResponse
Comment thread docs/openapi/paths/management/governance.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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 `@docs/openapi/openapi.json`:
- Line 39063: Update the OpenAPI schema default value from 20 to 25 so the spec
matches the server implementation (per issue `#3545`); locate the JSON node where
`"default": 20` is defined in the parameter/schema and change it to `"default":
25`, and verify any related examples or descriptions referencing the old default
are updated to reflect 25.
- Around line 61452-61456: The schema's "required" array currently lists
"total_count", "limit", and "offset" but must also include "customers" and
"count"; update the JSON schema definition that contains the "required" array to
add "customers" and "count" so it becomes
["total_count","limit","offset","customers","count"], ensuring the property
names match the existing "customers" and "count" property definitions in the
same schema.

In `@docs/openapi/paths/management/governance.yaml`:
- Around line 365-372: Update the OpenAPI spec's query parameter default for
"limit" from 20 to 25 to match the server behavior; locate the "limit" parameter
in the governance.yaml API path and change its "default" value to 25 so it
aligns with the default used by the ClampPaginationParams handler.

In `@docs/openapi/schemas/management/governance.yaml`:
- Around line 501-504: The OpenAPI schema for ListCustomersResponse is missing
required entries for the customers and count properties; update the required
array in the ListCustomersResponse schema to include "customers" and "count"
alongside "total_count", "limit", and "offset" so the response correctly
enforces those fields (look for the ListCustomersResponse schema and its
required list).
🪄 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: bcb66371-0ec1-4f24-b1dd-0308fe9c6e82

📥 Commits

Reviewing files that changed from the base of the PR and between 72ca78e and 53c59a2.

📒 Files selected for processing (3)
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/governance.yaml
  • docs/openapi/schemas/management/governance.yaml

Comment thread docs/openapi/openapi.json Outdated
Comment thread docs/openapi/openapi.json
Comment thread docs/openapi/paths/management/governance.yaml Outdated
Comment thread docs/openapi/schemas/management/governance.yaml
- Fix limit default: 20 → 25 to match ClampPaginationParams server behavior
- Fix limit: add maximum: 100 to governance.yaml (was missing)
- Fix ListCustomersResponse required: add customers and count alongside
  total_count/limit/offset
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@docs/openapi/paths/management/governance.yaml`:
- Around line 372-374: The `limit` parameter schema in the OpenAPI YAML has
duplicate/conflicting keys (two `default` entries and repeated `maximum`)
causing invalid YAML; update the `limit` parameter schema to remove the
duplicate `maximum` and the incorrect `default` (keep `default: 25` to match the
server's ClampPaginationParams) so the schema has a single `maximum: 100` and a
single `default: 25`.
🪄 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: 82ac659b-20ec-4127-9a65-e1a6fa23b890

📥 Commits

Reviewing files that changed from the base of the PR and between 53c59a2 and 70e90a0.

📒 Files selected for processing (3)
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/governance.yaml
  • docs/openapi/schemas/management/governance.yaml

Comment thread docs/openapi/paths/management/governance.yaml Outdated
- Remove duplicate maximum/default keys in governance.yaml limit schema
  (caused invalid YAML — parser-dependent behavior)
- Fix response field descriptions: limit/offset now say 'effective/clamped'
  value rather than 'echoes raw request param'
Comment thread docs/openapi/paths/management/governance.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/openapi/schemas/management/governance.yaml (2)

517-519: ⚡ Quick win

Add schema constraints to document the limit bounds.

The limit response field should include minimum: 1 and maximum: 100 constraints to precisely document the server's clamping behavior and enable validation.

📐 Proposed addition
     limit:
       type: integer
+      minimum: 1
+      maximum: 100
       description: Effective limit applied (clamped to maximum 100)
🤖 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 `@docs/openapi/schemas/management/governance.yaml` around lines 517 - 519, The
OpenAPI schema for the response field named "limit" is missing numeric bounds;
update the "limit" property in governance.yaml (the limit schema) to include
minimum: 1 and maximum: 100 so the documented/validated constraints match the
server's clamping behavior and keep the description as-is or clarify it if
desired.

520-522: ⚡ Quick win

Add schema constraint to document the offset bound.

The offset response field should include minimum: 0 to document that the server clamps negative offsets to zero.

📐 Proposed addition
     offset:
       type: integer
+      minimum: 0
       description: Effective offset applied
🤖 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 `@docs/openapi/schemas/management/governance.yaml` around lines 520 - 522, The
OpenAPI schema for the response field named "offset" lacks a lower bound; update
the "offset" property in the governance schema to include a numeric constraint
by adding "minimum: 0" under the "offset" definition so the documentation
reflects that negative values are clamped to zero; locate the "offset" property
in the governance YAML (the block with "offset:", "type: integer", "description:
Effective offset applied") and insert the "minimum: 0" entry.
🤖 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.

Nitpick comments:
In `@docs/openapi/schemas/management/governance.yaml`:
- Around line 517-519: The OpenAPI schema for the response field named "limit"
is missing numeric bounds; update the "limit" property in governance.yaml (the
limit schema) to include minimum: 1 and maximum: 100 so the documented/validated
constraints match the server's clamping behavior and keep the description as-is
or clarify it if desired.
- Around line 520-522: The OpenAPI schema for the response field named "offset"
lacks a lower bound; update the "offset" property in the governance schema to
include a numeric constraint by adding "minimum: 0" under the "offset"
definition so the documentation reflects that negative values are clamped to
zero; locate the "offset" property in the governance YAML (the block with
"offset:", "type: integer", "description: Effective offset applied") and insert
the "minimum: 0" entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df4a3d74-04f3-442d-bce8-448b3cadbe79

📥 Commits

Reviewing files that changed from the base of the PR and between 70e90a0 and 680575f.

📒 Files selected for processing (3)
  • docs/openapi/openapi.json
  • docs/openapi/paths/management/governance.yaml
  • docs/openapi/schemas/management/governance.yaml
💤 Files with no reviewable changes (1)
  • docs/openapi/paths/management/governance.yaml

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 20, 2026
Server only activates pagination when at least one of limit/offset/search
is present (governance.go line 2171). A bare GET with no params falls
through to the non-paginated path returning all customers.

- Remove default: 25 from limit schema (no default applies)
- Update description to clarify bare-request behavior
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.

GET /api/governance/customers has undocumented pagination + search params (v1.5.2)

1 participant