Skip to content

build SDK w/ new spec #1518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

build SDK w/ new spec #1518

wants to merge 8 commits into from

Conversation

xavdid-stripe
Copy link
Member

@xavdid-stripe xavdid-stripe commented May 16, 2025

DON'T MERGE. This is just to see the output of snapshots built w/ openapi v2.

CI may fail because of changes to DeletedObject, which is expected

@xavdid-stripe xavdid-stripe changed the title [WIP; no-merge] build SDK w/ new spec build SDK w/ new spec Jun 2, 2025
@@ -201,6 +201,7 @@ def request(
params=params,
requestor=requestor,
api_mode=api_mode,
v2_deleted_object=method == "delete" and api_mode == "V2",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the runtime code that ensures we turn delete responses into V2DeletedObject instead of EventDestination

We're not merging this second, but it's what we'll do when we are ready to merge.

@@ -198,6 +198,12 @@ def get_thin_event_classes():
return THIN_EVENT_CLASSES


def get_deleted_object():
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

busting a circular import

from stripe._stripe_object import StripeObject


class DeletedObject(StripeObject):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manually written class, references to which will get spit out by codegen

if path == self.v1_path:
assert isinstance(resp, Customer)
else:
assert isinstance(resp, DeletedObject)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actual tests to ensure that delete responses work as expected. Tests are green!

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.

1 participant