Regenerate with decimal_string enabled for v2 APIs#3329
Merged
jar-stripe merged 7 commits intomasterfrom Mar 20, 2026
Merged
Conversation
xavdid-stripe
approved these changes
Mar 19, 2026
…hanges System.Text.Json migration for stripe-dotnet. This commit contains all hand-written (non-generated) changes: - Add STJ package references and multi-TFM support - STJ converter implementations (AnyOf, Expandable, DateTime, Enum, etc.) - Engine swap: deserialize/serialize paths now use System.Text.Json - Base entity/service/options classes updated with STJ attributes - Hand-written entity and service classes updated with STJ attributes - Request serialization migrated to STJ - All tests updated for STJ as primary deserializer - Wholesome tests for STJ attribute coverage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
Machine-generated changes from OpenAPI spec codegen. All files in this commit contain the "File generated from our OpenAPI spec" header. Adds System.Text.Json attributes ([JsonPropertyName], [JsonConverter], etc.) to all generated entity and service option classes. This commit can be skipped during review — the hand-written infrastructure that drives these attributes is in the previous commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
…hase1 Committed-By-Agent: claude # Conflicts: # src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsCardPresent.cs # src/Stripe.net/Entities/Charges/ChargePaymentMethodDetailsInteracPresent.cs # src/Stripe.net/Entities/ConfirmationTokens/ConfirmationTokenPaymentMethodPreviewCardGeneratedFromPaymentMethodDetailsCardPresent.cs # src/Stripe.net/Entities/Mandates/MandatePaymentMethodDetailsBacsDebit.cs # src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsCardPresent.cs # src/Stripe.net/Entities/PaymentAttemptRecords/PaymentAttemptRecordPaymentMethodDetailsInteracPresent.cs # src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccount.cs # src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardGeneratedFromPaymentMethodDetailsCardPresent.cs # src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsCardPresent.cs # src/Stripe.net/Entities/PaymentRecords/PaymentRecordPaymentMethodDetailsInteracPresent.cs # src/Stripe.net/Entities/Reserve/Holds/Hold.cs # src/Stripe.net/Entities/Reserve/Holds/HoldReleaseSchedule.cs # src/Stripe.net/Entities/Reserve/Plans/Plan.cs # src/Stripe.net/Entities/Reserve/Plans/PlanFixedRelease.cs # src/Stripe.net/Entities/Reserve/Plans/PlanRollingRelease.cs # src/Stripe.net/Entities/Reserve/Releases/Release.cs # src/Stripe.net/Entities/Reserve/Releases/ReleaseSourceTransaction.cs # src/Stripe.net/Entities/Tax/Registrations/RegistrationCountryOptions.cs # src/Stripe.net/Entities/Tax/Registrations/RegistrationCountryOptionsLk.cs # src/Stripe.net/Entities/Terminal/Configurations/Configuration.cs # src/Stripe.net/Entities/Terminal/Configurations/ConfigurationCellular.cs # src/Stripe.net/Entities/Terminal/Configurations/ConfigurationStripeS710.cs # src/Stripe.net/Entities/V2/Billing/MeterEventAdjustments/MeterEventAdjustment.cs # src/Stripe.net/Entities/V2/Billing/MeterEventSessions/MeterEventSession.cs # src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsUsBankAccountOptions.cs # src/Stripe.net/Services/PaymentLinks/PaymentLinkUpdateOptions.cs # src/Stripe.net/Services/SubscriptionItems/SubscriptionItemDeleteOptions.cs # src/Stripe.net/Services/Tax/Registrations/RegistrationCountryOptionsLkOptions.cs # src/Stripe.net/Services/Tax/Registrations/RegistrationCountryOptionsOptions.cs # src/Stripe.net/Services/Terminal/Configurations/ConfigurationCellularOptions.cs # src/Stripe.net/Services/Terminal/Configurations/ConfigurationCreateOptions.cs # src/Stripe.net/Services/Terminal/Configurations/ConfigurationStripeS710Options.cs # src/Stripe.net/Services/Terminal/Configurations/ConfigurationUpdateOptions.cs
…d-trip test Delete NewtonsoftAndSystemTextJsonDeserializeTheSameObject which iterated over ~4700 entity types with reflection-heavy object population, causing CI timeouts (7+ minutes, killed by SIGTERM). Replace with a focused test in DeserializationTest that exercises every property type pattern (string, long, bool, decimal, decimal_string, DateTime, nested object, list, expandable field, map, StripeList) through both STJ and Newtonsoft deserialization and verifies equivalence. Add DecimalStringConverter attributes to close the one coverage gap. Other wholesome tests already verify all types have correct STJ attributes (PropertiesHaveAllNecessaryJsonAttributes, CorrectSystemTextJsonConvertersForTypes) and that serialization output matches (OutputTheSameObject). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
V2 API fields with `format: decimal` now generate as `decimal?` instead of `string`, matching v1 behavior. Driven by sdk-codegen#3369. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
b7e8ef1 to
bbf5aa2
Compare
This was referenced Mar 19, 2026
This was referenced Mar 26, 2026
This was referenced Apr 13, 2026
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.
Why?
V2 API decimal fields (e.g.
amounton billing meter events) were previously generated as plainstringtypes, even though the same fields in v1 are generated asdecimal?. A codegen workaround suppresseddecimal_stringtype mapping for all v2 APIs. That workaround has been removed.What?
decimal_stringenabled for v2 APIsMerge dependency
Testing
Integration tested against a live Stripe sandbox (6/6 tests passed):
decimal?deserialization from JSON string (STJ) ✓decimal?null when field absent ✓decimal?high precision (10 decimal places) ✓Amountconsolidation (sharedV2.Amountclass) ✓decimal?percentOwnership ✓decimal?percentOwnership ✓See Also
Changelog
stringtodecimal?. Code that reads or writes these fields asstringwill need to usedecimal?instead. Affected fields:PercentOwnershipPercentOwnershipAccountCreateIdentityIndividualRelationshipOptions,AccountUpdateIdentityIndividualRelationshipOptions,AccountTokenCreateIdentityIndividualRelationshipOptions,PersonCreateRelationshipOptions,PersonUpdateRelationshipOptions,PersonTokenCreateRelationshipOptions