docs(openapi): document billing verification errors#5493
Conversation
|
@tagadearpit is attempting to deploy a commit to the World Monitor Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryDocuments billing-verification failures in generated OpenAPI contracts.
Confidence Score: 4/5The PR is safe to merge, with a non-blocking maintainability issue in the runtime-source parsing. The generated billing contracts align with reachable authenticated behavior, but exact source-text sentinel checks make OpenAPI generation unnecessarily sensitive to behavior-preserving TypeScript refactors. scripts/lib/openapi-codegen.mjs Important Files Changed
Reviews (1): Last reviewed commit: "docs(openapi): document billing verifica..." | Re-trigger Greptile |
| if (!entitlementSrc.includes("code: 'entitlement_verification_unavailable'")) { | ||
| throw new Error('could not locate entitlement_verification_unavailable in server/_shared/entitlement-check.ts'); | ||
| } | ||
|
|
||
| const usageSrc = readFileSync(resolve(root, 'server/_shared/usage.ts'), 'utf8'); | ||
| if (!usageSrc.includes("'billing_verification_503'")) { | ||
| throw new Error('billing_verification_503 usage reason is missing — refusing to run'); |
There was a problem hiding this comment.
Avoid exact source-text sentinels
These checks depend on exact quoting and property text in runtime TypeScript, so a behavior-preserving refactor such as changing quote style or extracting the value blocks make generate. Parse the relevant declaration or export a shared machine-readable constant instead.
Knowledge Base Used: Proto/RPC contract system
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
rajpratham1
left a comment
There was a problem hiding this comment.
This pull request consistently documents billing verification and entitlement-related error responses across the OpenAPI specifications and supporting documentation. It updates the OpenAPI generation pipeline, regenerates the API specifications for all services, refreshes the generated documentation, and adds contract tests to validate the billing verification documentation. The visible changes are cohesive and appear to keep the generated artifacts, tooling, and tests in sync. No unresolved blocking issues are visible in the current diff.
Fixes koala73#5463 Signed-off-by: Arpit Tagade <[email protected]>
368f783 to
086df60
Compare
Summary
503responses on authenticated operationsRetry-After,X-Billing-Verification, and machine-readable error-code schemasForbiddenErrorfor gated403responses--checkinto OpenAPI generationFixes #5463
Validation
node --test --test-reporter=dot tests/openapi-billing-verification-contract.test.mjsnode --test --test-reporter=dot tests/openapi-rate-limit-errors-contract.test.mjs