Update generated code for private-preview - #1893
Open
stripe-openapi[bot] wants to merge 10 commits into
Open
Conversation
…8788c6f (#1876) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
stripe-openapi
Bot
requested review from
xavdid
and removed request for
a team and
xavdid
August 27, 2026 08:04
stripe-openapi
Bot
force-pushed
the
latest-codegen-private-preview
branch
6 times, most recently
from
August 27, 2026 17:10
3560931 to
953f84f
Compare
* Add zizmor config scoping the ref-pin policy to the stripe namespace Actions under stripe/* are first-party and tracked on a branch on purpose, so requiring a commit hash for them would be churn without a security gain. Scoping the policy to that namespace keeps the blanket hash requirement in force for every third-party action. This lands before the pins so the auto-fixer honours the policy and leaves stripe/openapi/actions/* alone rather than hash-pinning them for a revert. Committed-By-Agent: claude * Pin GitHub Actions references to commit hashes A tag is a mutable pointer, so any action referenced by tag can change what CI executes without a commit here. Pinning to a full commit hash makes the reference immutable and the version comment auditable. Thirteen of the fourteen pins came from the auto-fixer; every hash was then resolved against its claimed tag through the GitHub API before committing. pypa/gh-action-pypi-publish was pinned by hand because the auto-fixer cannot resolve a version for a branch reference. It tracked release/v1, whose head is currently tag v1.14.2, so the pin is both immutable and current. Dependabot would be the mechanism to keep it moving. Also sets persist-credentials: false on all three checkouts. The default leaves the workflow token in .git/config for the rest of the job, where any later step can read it; none of these jobs push, so nothing needs it retained. Committed-By-Agent: claude * Upgrade pinned actions off end-of-life runtimes Pinning froze these at the versions master happened to reference, and four of the five were on a Node runtime GitHub force-migrates, which every job warns about today: extractions/setup-just v2.0.0 -> v4.0.0 actions/checkout v3.7.0 -> v7.0.1 (node16 -> node24) actions/setup-python v4.9.1 -> v7.0.0 (node16 -> node24) actions/upload-artifact v4.6.2 -> v7.0.1 (node20 -> node24) actions/download-artifact v4.3.0 -> v8.0.1 (node20 -> node24) The artifact pair moves together on purpose: build uploads dist and publish downloads it, and upload v7 / download v8 are the majors upstream ships as a pair. download-artifact v5's breaking change is scoped to downloads by ID; this one downloads by name, so it does not apply. v8 skips decompression based on Content-Type, which only diverges when the uploader sets archive: false, and this workflow does not. setup-python's cache input has no default in v7, unlike setup-node's package-manager-cache from v5 onward, so the upgrade adds no cache surface to audit. v7 drops the pip-install input, which this workflow never set. All five majors require Actions runner 2.327.1 or later, which the GitHub-hosted runners this workflow uses already satisfy. Committed-By-Agent: claude * document download-artifact v8 digest-mismatch behavior v8 fails the job on an artifact digest mismatch where v4 only logged a warning. The publish job is tag-gated, so CI never exercises it — the first person to see this failure will be mid-release, and the escape hatch should be next to the code rather than in a PR body. Committed-By-Agent: claude * Add zizmor workflow security check Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com> * Add temporary release workflow probe Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com> * Remove temporary release workflow probe Committed-By-Agent: codex Co-authored-by: codex <noreply@openai.com> --------- Co-authored-by: codex <noreply@openai.com>
* Add discriminated union serialization tests
Tests discriminated union type shapes for both request-side (TypedDict
params with Literal discriminator) and response-side (StripeObject
deserialization), covering standalone and inline variants.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
* Clarify test docstring scope and dict() comment
The module docstring now explicitly states these tests exercise runtime
semantics (dict construction, field access, round-trip), not static type
narrowing. The dict() comment explains what it's actually testing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
* Rewrite DU tests: correct inline pattern + route through _api_encode
Inline union tests now use the flattened TypedDict pattern (discriminator
and per-variant payload fields on the parent) rather than the incorrect
per-variant TypedDicts-with-type-field pattern that was there before.
Request-side tests now exercise `_api_encode` so they verify real SDK
encoding behavior (bracket notation, nested dicts) rather than just dict
construction and key lookup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
* Dispatch discriminated union fields to their variant class
A discriminated union field arrived as a dict with no class attached, so it
became a bare StripeObject. That object carries no `_field_encodings`, so an
int64 or decimal field inside a variant stayed a string — `luminance` came
back as "1500" rather than 1500.
Codegen already emits `_inner_class_union_variant_types` on the parent
(`{"color": ("model", {"rgb": RgbColor, ...})}`); nothing read it. Consume it
in `_update_attributes` so the discriminator inside the value selects the
variant class, which then applies its own encodings.
Mirrors stripe-ruby#1923. Falls back to a plain StripeObject when the
discriminator is absent, is not a string, or names a variant this release
does not know, so a variant the API adds later still deserializes.
Rewrites tests/test_discriminated_unions.py, which could not detect any of
this: every response-side test ran `StripeObject.construct_from` on the base
class with no variant map, so all seven passed identically against `{"foo":
1}`. The fixtures now mirror the generated shape — two color variants with
*different* encodings — so identical wire bytes hydrate differently based
only on the discriminator. Seven of the 24 tests fail with the dispatch line
reverted.
The request side moves from `_api_encode` to `_coerce_v2_params`.
`_api_encode` is v1 form encoding, which treats any dict identically and so
asserted nothing about unions; v2 requests coerce through the method-level
schema. One test pins the generator's deliberate flattening of variants into
one field-name-keyed map.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Committed-By-Agent: claude
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Replace --quiet with stdout redirection. Ruff's --quiet flag suppresses all output including parse errors (e.g. merge markers), making format failures in CI impossible to diagnose. Redirecting stdout to /dev/null suppresses the file list but lets errors (which go to stderr) through. Committed-By-Agent: claude Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
stripe-openapi
Bot
force-pushed
the
latest-codegen-private-preview
branch
from
August 28, 2026 19:45
953f84f to
d01d95c
Compare
private-preview's ci.yml differs from master's by one additive hunk: `private-preview` in `on.push.branches`. Because that hunk lives only on private-preview, every merge of master into private-preview yields a workflow blob matching neither parent. GitHub refuses a push from a GitHub App lacking `workflows` permission when it introduces a workflow blob that does not already exist in the repository, so the codegen repo's Codegen job's push to latest-codegen-private-preview is rejected and a human has to perform the merge by hand. Holding the hunk on master too means both sides of the merge carry the same change, the merge result is byte-identical to master's blob, and the App only ever carries an already-committed file forward. The hunk is a no-op on master. For a push event the workflow file comes from the pushed ref, so master's copy listing private-preview is never consulted for a push to private-preview, and it cannot affect pushes to master or beta. `on.pull_request.branches` already lists private-preview. Committed-By-Agent: claude Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
stripe-openapi
Bot
force-pushed
the
latest-codegen-private-preview
branch
5 times, most recently
from
August 31, 2026 15:27
c1dba90 to
42d48ae
Compare
* Add open vs closed enum section to README * Put type sig in code block
stripe-openapi
Bot
force-pushed
the
latest-codegen-private-preview
branch
2 times, most recently
from
August 31, 2026 20:45
56cc239 to
0acb4fc
Compare
…1898) * swap to a secure multipart boundary * use monkeypatch insteado of bare assignment * remove unneded comments
* validate that incoming urls don't redirect requests * shorten comments
…f448d4a4c4d336d1b491ce684f
stripe-openapi
Bot
force-pushed
the
latest-codegen-private-preview
branch
from
August 31, 2026 22:25
0acb4fc to
3531023
Compare
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.
Codegen for openapi v2456 and v2 openapi ea0f8e8d45ce01f448d4a4c4d336d1b491ce684f.
Changelog
create,deactivate,list,modify, andretrievemethods on resourcebilling.FeedbackOptiondisable_stripe_user_authenticationonAccountSessionCreateParamsComponentPaymentMethodSettingFeaturecapital_financing_manual_paymentonAccountSession.Componentsequra_paymentsonAccount.Capabilityfeedback_optionsonbilling_portal.ConfigurationCreateParamsFeatureSubscriptionCancelCancellationReasonandbilling_portal.ConfigurationModifyParamsFeatureSubscriptionCancelCancellationReasonfundbox_ca_financingon enumCapital.FinancingSummary.Detail.disclaimer_variantsequraonCharge.PaymentMethodDetail,Checkout.Session.PaymentMethodOption,ConfirmationToken.PaymentMethodPreview,PaymentAttemptRecord.PaymentMethodDetail,PaymentIntent.PaymentMethodOption, andPaymentRecord.PaymentMethodDetaildata_share_onlyfrom enumsCharge.PaymentMethodDetail.Card.ThreeDSecure.result,PaymentAttemptRecord.PaymentMethodDetail.Card.ThreeDSecure.result,PaymentRecord.PaymentMethodDetail.Card.ThreeDSecure.result, andSetupAttempt.PaymentMethodDetail.Card.ThreeDSecure.resultfunding_types_blockedoncheckout.SessionCreateParamsPaymentMethodOptionCardRestrictionpayment_intent_dataoncheckout.SessionModifyParamsCheckout.Session.PaymentMethodOption.Bancontact.setup_future_usagefromliteral('none')toenum('none'|'off_session')sequraon enumsConfirmationTokenCreateParamsPaymentMethodDatum.type,PaymentIntentConfirmParamsPaymentMethodDatum.type,PaymentIntentCreateParamsPaymentMethodDatum.type,PaymentIntentModifyParamsPaymentMethodDatum.type,SetupIntentConfirmParamsPaymentMethodDatum.type,SetupIntentCreateParamsPaymentMethodDatum.type, andSetupIntentModifyParamsPaymentMethodDatum.typemetadataonConfirmationTokensequraon enumsConfirmationToken.PaymentMethodPreview.typeandPaymentMethod.typeactive_entitlementsandcustomer_portalonCustomerSessionCreateParamsComponentsequraon enumsCustomerListPaymentMethodsParams.type,PaymentMethodCreateParams.type, andPaymentMethodListParams.typeaddress_match_confidenceandname_match_confidenceonIdentity.VerificationReport.EmailandIdentity.VerificationReport.Phonedomain_country,email_exists_confidence,observed_domain_tenure_days,observed_email_tenure_days, andphone_match_confidenceonIdentity.VerificationReport.Emailemail_address_mismatch,email_name_mismatch,email_ownership_unverified,email_phone_mismatch, andemail_short_tenureon enumIdentity.VerificationReport.Email.Error.codecarrier,line_type, andobserved_phone_tenure_daysonIdentity.VerificationReport.Phonephone_address_mismatch,phone_invalid_line_type,phone_invalid,phone_name_mismatch,phone_ownership_unverified,phone_short_tenure, andphone_unsupported_countryon enumIdentity.VerificationReport.Phone.Error.codeemail_address_mismatch,email_name_mismatch,email_ownership_unverified,email_phone_mismatch,email_short_tenure,phone_address_mismatch,phone_invalid_line_type,phone_invalid,phone_name_mismatch,phone_ownership_unverified,phone_short_tenure, andphone_unsupported_countryon enumIdentity.VerificationSession.LastError.codetruemoneyon enumsInvoice.PaymentSetting.payment_method_types,InvoiceCreateParamsPaymentSetting.payment_method_types,InvoiceModifyParamsPaymentSetting.payment_method_types,QuotePreviewInvoice.PaymentSetting.payment_method_types,Subscription.PaymentSetting.payment_method_types,SubscriptionCreateParamsPaymentSetting.payment_method_types, andSubscriptionModifyParamsPaymentSetting.payment_method_typesmerchant_canceledon enumsPaymentAttemptRecordReportCanceledParams.reasonandPaymentRecordReportPaymentAttemptCanceledParams.reasonpayment_method_typesonPaymentIntentConfirmParams,PaymentIntentCreateParams,PaymentIntentModifyParams,SetupIntentCreateParams, andSetupIntentModifyParamstouch_n_goon enumsPaymentIntent.allowed_payment_method_types,PaymentIntentConfirmParams.allowed_payment_method_types,PaymentIntentCreateParams.allowed_payment_method_types,PaymentIntentModifyParams.allowed_payment_method_types,SetupIntent.allowed_payment_method_types,SetupIntentConfirmParams.allowed_payment_method_types,SetupIntentCreateParams.allowed_payment_method_types, andSetupIntentModifyParams.allowed_payment_method_typessequraon enumsPaymentIntent.excluded_payment_method_types,PaymentIntentConfirmParams.excluded_payment_method_types,PaymentIntentCreateParams.excluded_payment_method_types,PaymentIntentModifyParams.excluded_payment_method_types,SetupIntent.excluded_payment_method_types,SetupIntentCreateParams.excluded_payment_method_types, andSetupIntentModifyParams.excluded_payment_method_typesPaymentIntent.allowed_payment_method_typesandSetupIntent.allowed_payment_method_typesto be requiredapplication_fee_amount,application_fee_percent,on_behalf_of, andtransfer_dataonPaymentLinkModifyParamscanceledonPaymentRecordReportPaymentAttemptParamsandPaymentRecordReportPaymentParamsProductCatalog.TrialOffer.pricefrom$Pricetodeletable($Price)ProductCatalog.TrialOffer.nameto be optionalrecurringonSharedPayment.GrantedToken.UsageLimit,SharedPayment.IssuedToken.UsageLimit,shared_payment.GrantedTokenCreateParamsUsageLimit, andshared_payment.IssuedTokenCreateParamsUsageLimitfeedback_optiononSubscriptionCancelParamsCancellationDetailandSubscriptionModifyParamsCancellationDetailpricing_tokenonSubscriptionModifyParamsigicontax.RegistrationCreateParamsCountryOptionAt,tax.RegistrationCreateParamsCountryOptionBe,tax.RegistrationCreateParamsCountryOptionBg,tax.RegistrationCreateParamsCountryOptionCy,tax.RegistrationCreateParamsCountryOptionCz,tax.RegistrationCreateParamsCountryOptionDe,tax.RegistrationCreateParamsCountryOptionDk,tax.RegistrationCreateParamsCountryOptionE,tax.RegistrationCreateParamsCountryOptionEe,tax.RegistrationCreateParamsCountryOptionFi,tax.RegistrationCreateParamsCountryOptionFr,tax.RegistrationCreateParamsCountryOptionGr,tax.RegistrationCreateParamsCountryOptionHr,tax.RegistrationCreateParamsCountryOptionHu,tax.RegistrationCreateParamsCountryOptionIe,tax.RegistrationCreateParamsCountryOptionIt,tax.RegistrationCreateParamsCountryOptionLt,tax.RegistrationCreateParamsCountryOptionLu,tax.RegistrationCreateParamsCountryOptionLv,tax.RegistrationCreateParamsCountryOptionMt,tax.RegistrationCreateParamsCountryOptionNl,tax.RegistrationCreateParamsCountryOptionPl,tax.RegistrationCreateParamsCountryOptionPt,tax.RegistrationCreateParamsCountryOptionRo,tax.RegistrationCreateParamsCountryOptionSe,tax.RegistrationCreateParamsCountryOptionSi, andtax.RegistrationCreateParamsCountryOptionSk2026-08-26.dahliaon enumWebhookEndpointCreateParams.api_versionauthentication_failure,capability_not_active,expired_payment_method,incorrect_postal_code,invalid_canceled_subscription_fields, andpayment_method_restrictedonInvoice.LastFinalizationError,PaymentIntent.LastPaymentError,QuotePreviewInvoice.LastFinalizationError,SetupAttempt.SetupError,SetupIntent.LastSetupError,StripeError, andTerminal.Reader.Action.ApiError