feat:Remove payment endpoints and add error handling schemas#258
feat:Remove payment endpoints and add error handling schemas#258
Conversation
WalkthroughThe PR restructures the DeepInfra OpenAPI specification by removing payment-related endpoints and schemas (approximately 772 lines) while introducing standardized error handling schemas (HTTPValidationError, ValidationError) and a Checklist schema for account status management (approximately 108 lines). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/libs/DeepInfra/openapi.yaml`:
- Around line 5152-5201: The OpenAPI change made Checklist.limit and
Checklist.suspend_reason required, but the generated model still has nullable
types; regenerate the SDK from the updated openapi.yaml (or update the generated
model class DeepInfra.Models.Checklist) so that the Limit property is a
non-nullable number (e.g., change public double? Limit to public double Limit)
and SuspendReason is non-nullable (remove nullable wrapper so SuspendReason is
not nullable), and ensure constructors/deserialization/validation reflect these
fields as required rather than optional.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e234760-b765-47ec-ac85-2fae0e95fc8b
⛔ Files ignored due to path filters (108)
src/libs/DeepInfra/Generated/DeepInfra..JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.AddFunds.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.BillingPortal.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.DeepstartApply.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetChecklist.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.GetConfig.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetConfig.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.SetupTopup.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.Usage.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageApiToken.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageRent.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.UsageTokens.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.AddFunds.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.BillingPortal.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.DeepstartApply.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetChecklist.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.GetConfig.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetConfig.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.SetupTopup.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.Usage.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageApiToken.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageRent.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.UsageTokens.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsIn.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostResponse.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.AddFundsPaymentFundsPostSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalOut.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetReturnUrl.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.BillingPortalPaymentBillingPortalGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigIn.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigInLimit.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ConfigOut.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationIn.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInDeal.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationInUid.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOut.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutDeal.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutEmail.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepStartApplicationOutUid.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DeepstartApplyPaymentDeepstartApplicationPostSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMeta.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.DiscountMetaDescription.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.GetChecklistPaymentChecklistGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.GetConfigPaymentConfigGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMeta.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetaPlanId.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetConfigPaymentConfigPostSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostResponse.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.SetupTopupPaymentTopupPostSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.TimeInterval.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.TopUpIn.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageApiTokenPaymentUsageApiTokenGetTo.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItem.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageItemDiscount.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageMonth.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageOut.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsagePaymentUsageGetTo.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOut.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentOutIdToDuration.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageRentPaymentUsageRentGetTo.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetSession.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.UsageTokensPaymentUsageTokensGetTo.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/DeepInfra/openapi.yaml
| Checklist: | ||
| title: Checklist | ||
| required: | ||
| - stripe_balance | ||
| - recent | ||
| - limit | ||
| - suspend_reason | ||
| type: object | ||
| properties: | ||
| email: | ||
| title: Email | ||
| type: boolean | ||
| default: false | ||
| billing_address: | ||
| title: Billing Address | ||
| type: boolean | ||
| default: false | ||
| payment_method: | ||
| title: Payment Method | ||
| type: boolean | ||
| default: false | ||
| suspended: | ||
| title: Suspended | ||
| type: boolean | ||
| default: false | ||
| overdue_invoices: | ||
| title: Overdue Invoices | ||
| type: number | ||
| default: 0.0 | ||
| last_checked: | ||
| title: Last Checked | ||
| type: integer | ||
| default: 0 | ||
| stripe_balance: | ||
| title: Stripe Balance | ||
| type: number | ||
| description: Negative value indicates funds ready-to-spend. Positive value indicates money owed | ||
| recent: | ||
| title: Recent | ||
| type: number | ||
| description: usage since most recent invoice | ||
| limit: | ||
| title: Limit | ||
| anyOf: | ||
| - type: number | ||
| - type: 'null' | ||
| suspend_reason: | ||
| anyOf: | ||
| - $ref: '#/components/schemas/SuspendReason' | ||
| - type: 'null' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
wc -l src/libs/DeepInfra/openapi.yamlRepository: tryAGI/DeepInfra
Length of output: 96
🏁 Script executed:
# Check the Checklist schema around lines 5152-5201
sed -n '5150,5210p' src/libs/DeepInfra/openapi.yamlRepository: tryAGI/DeepInfra
Length of output: 1652
🏁 Script executed:
# Check the SuspendReason schema around lines 8766-8775
sed -n '8760,8780p' src/libs/DeepInfra/openapi.yamlRepository: tryAGI/DeepInfra
Length of output: 608
🏁 Script executed:
# Check the generated C# files to see their current state
if [ -f src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs ]; then
echo "=== Checklist.g.cs ==="
wc -l src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs
cat -n src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs | head -100
fiRepository: tryAGI/DeepInfra
Length of output: 4254
🏁 Script executed:
# Check SuspendReason generated C# file
if [ -f src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs ]; then
echo "=== SuspendReason.g.cs ==="
wc -l src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs
cat -n src/libs/DeepInfra/Generated/DeepInfra.Models.SuspendReason.g.cs
fiRepository: tryAGI/DeepInfra
Length of output: 2729
🏁 Script executed:
# Check if there's a script or documentation about regenerating the SDK
fd -e ps1 -e sh -e py "codegen\|generate\|build" src/libs/DeepInfra/ 2>/dev/null | head -20Repository: tryAGI/DeepInfra
Length of output: 42
🏁 Script executed:
# Look for any README or scripts in the DeepInfra directory
ls -la src/libs/DeepInfra/ | grep -E "README|script|build|generate"Repository: tryAGI/DeepInfra
Length of output: 122
🏁 Script executed:
cat src/libs/DeepInfra/generate.shRepository: tryAGI/DeepInfra
Length of output: 618
Regenerate the checked-in SDK for the updated Checklist contract.
Lines 5154-5158 make limit and suspend_reason required fields. The generated src/libs/DeepInfra/Generated/DeepInfra.Models.Checklist.g.cs still marks these as optional: Limit on line 65 is public double? Limit and SuspendReason on line 71 is public global::DeepInfra.SuspendReason? SuspendReason, when both should be required per the updated schema.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/libs/DeepInfra/openapi.yaml` around lines 5152 - 5201, The OpenAPI change
made Checklist.limit and Checklist.suspend_reason required, but the generated
model still has nullable types; regenerate the SDK from the updated openapi.yaml
(or update the generated model class DeepInfra.Models.Checklist) so that the
Limit property is a non-nullable number (e.g., change public double? Limit to
public double Limit) and SuspendReason is non-nullable (remove nullable wrapper
so SuspendReason is not nullable), and ensure
constructors/deserialization/validation reflect these fields as required rather
than optional.
Summary by CodeRabbit
Breaking Changes
Refactor