Skip to content

fix: add missing 429 responses to all ASM API endpoints#26

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-8y8dbz
Open

fix: add missing 429 responses to all ASM API endpoints#26
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-8y8dbz

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Problem

Rate limiting is documented in the API description as applying globally (600 req/min per API key), but only 2 of 12 endpoints — GET /assets and POST /scans — included a 429 Too Many Requests response. The remaining 10 endpoints had no 429 documented, which means:

  • API clients reading per-endpoint docs would not know to handle rate limit errors on those routes
  • SDK generators and mock servers would not include 429 handling for those endpoints
  • The contract was inconsistent and misleading

Additionally, the BadRequest and RateLimited shared responses had no example bodies, while Unauthorized and NotFound did — leaving consumers to guess the exact error shape for validation errors and rate limit responses.

Changes

  • Added 429: $ref: '#/components/responses/RateLimited' to all 10 endpoints that were missing it
  • Added a concrete example to the BadRequest response (showing validation_error with a details array)
  • Added a concrete example to the RateLimited response (showing rate_limit_exceeded)

Test plan

  • Validate that spectral lint asm/openapi.yaml --ruleset spectral:oas --fail-severity warn passes (CI will confirm)
  • Verify the interactive Redoc docs show 429 on every endpoint after deploy

🤖 Generated with Claude Code

https://claude.ai/code/session_01BDzMdBoa8dBfEy9wWd1FVD


Generated by Claude Code

Rate limiting (600 req/min per API key) applies globally but was only
documented on 2 of 12 endpoints. Added the RateLimited response to all
10 remaining endpoints so clients know to handle 429 everywhere.

Also added response body examples to BadRequest and RateLimited to match
the pattern already set by Unauthorized and NotFound, making the error
contract consistent and easier to implement against.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BDzMdBoa8dBfEy9wWd1FVD
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.

2 participants