Skip to content

feat(api)!: standardize all list endpoints with pagination wrappers#128

Merged
ericfitz merged 8 commits intomainfrom
feature/standardize-list-responses
Feb 2, 2026
Merged

feat(api)!: standardize all list endpoints with pagination wrappers#128
ericfitz merged 8 commits intomainfrom
feature/standardize-list-responses

Conversation

@ericfitz
Copy link
Owner

@ericfitz ericfitz commented Feb 2, 2026

Summary

  • Standardize all list endpoints to return consistent pagination wrapper responses
  • Add total_count, limit, offset fields to all collection responses
  • Fix settings list query using incorrect column name (500 errors)
  • Rename jwks_url to jwks_uri for RFC 9728 compliance
  • Add missing OpenAPI examples, responses, and Configuration tag
  • Remove unused godotenv dependency
  • Update Postman collections and CATS false positive rules

Breaking Changes

List endpoints now return a wrapper object with pagination metadata instead of raw arrays:

{
  "items": [...],
  "total_count": 10,
  "limit": 20,
  "offset": 0
}

Test plan

  • Unit tests pass
  • Integration tests updated for new response format
  • Postman collections updated
  • CATS fuzzing rules updated for false positives

🤖 Generated with Claude Code

ericfitz and others added 8 commits February 1, 2026 16:38
BREAKING CHANGE: All list endpoints now return wrapped responses with
pagination metadata instead of raw arrays.

New response format:
{
  "<items>": [...],
  "total": <total count before pagination>,
  "limit": <requested limit>,
  "offset": <requested offset>
}

Changes include:
- Add 13 new response schemas to OpenAPI spec (ListThreatModelsResponse,
  ListThreatsResponse, ListDiagramsResponse, ListDocumentsResponse,
  ListNotesResponse, ListAssetsResponse, ListRepositoriesResponse,
  ListWebhookSubscriptionsResponse, ListWebhookDeliveriesResponse,
  ListUserQuotasResponse, ListWebhookQuotasResponse, ListAddonQuotasResponse,
  ListClientCredentialsResponse)
- Fix ListAdministratorsResponse to include limit/offset fields
- Add Count() methods to all stores for proper total calculation
- Update all list endpoint handlers to use wrapped response format
- Add pagination support to /me/client_credentials endpoint
- Fix missing filter implementations (status, status_updated_after,
  status_updated_before in threat models; addon_id in invocations)
- Update all unit and integration tests for new response format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 429 rate limit responses to config and admin settings endpoints,
400 validation responses where missing, and define Configuration tag.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add examples to all List*Response pagination properties and array
fields, endpoint media types, and migrate response. Fix missing
type in JsonPatchDocument array items schema.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test assertions to handle new list endpoint response format with
pagination wrappers (e.g., {threat_models: [...], total, limit, offset})
instead of raw arrays. Add update script for future schema migrations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The OAuthProtectedResourceMetadata schema incorrectly used jwks_url
instead of the RFC 9728-specified field name jwks_uri.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… settings

Add two new false positive detection rules to parse-cats-results.py:

- DELETE_ME_CHALLENGE: DELETE /me returns 400 without challenge param.
  This is correct behavior - the two-step deletion flow requires the
  challenge parameter for safety.

- ADMIN_SETTINGS_RESERVED: Reserved setting keys (e.g., "migrate")
  return 400. This is correct - "migrate" is reserved for the
  POST /admin/settings/migrate endpoint.

These rules reduce false positives in CATS fuzzing results by correctly
identifying expected API behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The SettingsService.List() method was using Order("key") but the
database column is "setting_key", causing 500 errors on GET /admin/settings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dosubot
Copy link

dosubot bot commented Feb 2, 2026

Related Documentation

No published documentation to review for changes on this repository.

Write your first living document

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the enhancement New feature or request label Feb 2, 2026
@ericfitz ericfitz merged commit 503212a into main Feb 2, 2026
7 checks passed
@ericfitz ericfitz deleted the feature/standardize-list-responses branch February 2, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant