Skip to content

fix(asm): add missing 429 responses and document rate-limit headers#31

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

fix(asm): add missing 429 responses and document rate-limit headers#31
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-yfz4wx

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Problem

The ASM spec description explicitly states:

The current limit and remaining quota are returned in X-RateLimit-Limit and X-RateLimit-Remaining response headers.

But the spec itself never modelled those headers, and only 2 of the 13 operations (GET /assets, POST /scans) declared a 429 Too Many Requests response. The other 11 operations silently omit it.

This creates three concrete problems for API consumers:

  1. SDK generators (openapi-generator, kiota, etc.) won't emit rate-limit header accessors because no response declares them.
  2. The Redoc UI shows no 429 tab on most operations, so developers don't know they need to handle it.
  3. The RateLimited response component was missing the very headers the description promised, making the 429 body less useful for backoff logic.

Changes

  • Added components/headers/X-RateLimit-Limit and components/headers/X-RateLimit-Remaining reusable header definitions.
  • Wired both headers into the existing RateLimited response component (alongside the existing Retry-After header).
  • Added '429': $ref: '#/components/responses/RateLimited' to the 11 operations that were missing it:
    • GET /assets/{asset_id}
    • PATCH /assets/{asset_id}
    • DELETE /assets/{asset_id}
    • GET /scans
    • GET /scans/{scan_id}
    • GET /vulnerabilities
    • GET /vulnerabilities/{vuln_id}
    • PATCH /vulnerabilities/{vuln_id}
    • GET /tags
    • POST /tags

Validation

Spectral lint passes with zero errors: No results with a severity of 'error' found!


Generated by Claude Code

The spec description stated that X-RateLimit-Limit and X-RateLimit-Remaining
are returned on every response, but neither header was modelled anywhere and
only 2 of 13 endpoints declared a 429. This adds a reusable components/headers
block for those two headers, wires them into the RateLimited response component,
and adds the 429 ref to the 11 endpoints that were missing it so SDK generators
and the Redoc UI surface rate-limit behaviour consistently across all operations.

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