fix: add missing 429 responses to all ASM API endpoints#26
Open
dmchaledev wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 /assetsandPOST /scans— included a429 Too Many Requestsresponse. The remaining 10 endpoints had no429documented, which means:Additionally, the
BadRequestandRateLimitedshared responses had no example bodies, whileUnauthorizedandNotFounddid — leaving consumers to guess the exact error shape for validation errors and rate limit responses.Changes
429: $ref: '#/components/responses/RateLimited'to all 10 endpoints that were missing itexampleto theBadRequestresponse (showingvalidation_errorwith adetailsarray)exampleto theRateLimitedresponse (showingrate_limit_exceeded)Test plan
spectral lint asm/openapi.yaml --ruleset spectral:oas --fail-severity warnpasses (CI will confirm)🤖 Generated with Claude Code
https://claude.ai/code/session_01BDzMdBoa8dBfEy9wWd1FVD
Generated by Claude Code