Skip to content

Conversation

xavdid-stripe
Copy link
Member

Why?

The typing of delete calls has always been a little confusing in V1: SDKs say they return an entire object (like a Customer) but with the deleted property set to True. That's true for some APIs but not for others. For consistency, we just always say you get a "real" object.

V2 APIs are more strict about the data they return: there's only ever id and object. To better represent this, we're now generating a V2.DeletedObject class that is returned from all v2 delete calls. This PR includes that generated class, but APIRequestor-related code to use it when appropreate.

Note: this PR is generated using the V2 OpenAPI spec rather than the protos so that the DeletedObject class is generated.

What?

  • add param to _convert_to_stripe_object
  • provide that param from the API requestor
  • add tests

See Also

DEVSDK-2588

@xavdid-stripe xavdid-stripe marked this pull request as ready for review August 6, 2025 23:03
@xavdid-stripe xavdid-stripe requested a review from a team as a code owner August 6, 2025 23:03
@xavdid-stripe xavdid-stripe requested review from helenye-stripe and removed request for a team August 6, 2025 23:03
@xavdid-stripe xavdid-stripe changed the base branch from sdk-release/next-major to sdk-releases/next-major August 6, 2025 23:21
@helenye-stripe
Copy link
Contributor

I'm peaceful with this but won't the generated changes get removed by CI since we'll go back to using the proto spec to generate the SDK?

@xavdid-stripe xavdid-stripe changed the base branch from sdk-releases/next-major to sdk-release/next-major August 7, 2025 21:03
@xavdid-stripe
Copy link
Member Author

I'm peaceful with this but won't the generated changes get removed by CI since we'll go back to using the proto spec to generate the SDK?

the manual changes won't. Plus I don't think we're running codegen against sdk-release/next-major. Worst case scenario, CI fails beacuse it's using this code against the proto generation, but I think it won't (because of the branch). The ordering is definitely tricky there though!

@xavdid-stripe xavdid-stripe merged commit be8cab1 into sdk-release/next-major Aug 9, 2025
14 checks passed
@xavdid-stripe xavdid-stripe deleted the DEVSDK-2588 branch August 9, 2025 01:22
xavdid-stripe added a commit that referenced this pull request Sep 5, 2025
* add support for v2 deleted objects
helenye-stripe pushed a commit that referenced this pull request Sep 22, 2025
* Update generated code for v1868 and 2025-07-30.basil (#1541)

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Bump version to 12.4.0

* Introduce V1 namespaces in StripeClient (#1549)

* Introduced V1 namespaces

* Updated migration guide link

* Import available http libraries more efficiently (#1553)

* replace import stragety, fix some tests

[skip ci]

* wip fixing tests

[skip ci]

* [claude] fix tests

* formatting

* test cleanup

* tests are fast

* final cleanup

* remove comment

* remove accidential files

* tweak import logic

* Update generated code for v1932 and 2025-08-27.basil (#1544)

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>

* Add section on private preview SDKs in readme (#1554)

* Bump version to 12.5.0

* Add private-preview branch to CI workflow triggers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: paginate backwards if `starting_after == None` (#1563)

This fixes the case where `starting_after` is present in
`_retrieve_params` but is `None` so that the `auto_paging_iter`
correctly paginates backwards.

closes #1562

* Bump version to 12.5.1

* add support for v2 deleted objects (#1543)

* add support for v2 deleted objects

* revert event destination return type

* ⚠️ Build SDK w/ V2 OpenAPI spec (#1565)

* generate w/ v2 openapi spec

* gen again

* gen

* Updated stripeclient snippets in Readme.md (#1528)

* Don't use mutable default arguments (#1570)

* generate default assignments

* add mutable args linter and fix errors

* type generated args more accurately

* only initialize optional params when needed

* generate private-preview

---------

Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <ramya@stripe.com>
Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com>
Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
Co-authored-by: Michael Broshi <mbroshi@stripe.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Ryan Causey <ryan.causey@munipal.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants