Skip to content
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

Remove empty resources created for service groupings #2215

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

jar-stripe
Copy link
Contributor

@jar-stripe jar-stripe commented Oct 23, 2024

Why?

The code generator had previously generated resources for V2 services that only contain other services, like V2.Billing, V2.Core, etc. This is undesirable because it produces strangely named files and confusing empty types. This PR updates contains generated code after modifying the code generator to treat these services like namespaces instead of resource-ful services.

This could be a breaking change as the CoreResource.d.ts and BillingResource.d.ts type definitions are being removed. The following therefore would be a type error after this change:

  const billing: Stripe.V2.BillingResource = client.v2.billing;
  const meters = await billing.meterEvents.create({

It does not change the access path through StripeClient or the interface of the services, though.

What?

  • removes src/resources/V2.ts, src/resources/Billing.ts, and src/resources/V2/Core.ts
  • removes types/V2/BillingResource.d.ts, types/V2/CoreResource.d.ts, and types/V2Resource.d.ts
  • adds services that used to be in these files to objects within src/resources.ts

See also

http://go/j/DEVSDK-2196

Changelog

  • Remove Stripe.V2.BillingResource, Stripe.V2.CoreResource, and Stripe.V2Resource types from the public interface as they are no longer needed. SDK usage will not be affected but any references to these types in your application will need to be removed.

@jar-stripe jar-stripe requested a review from a team as a code owner October 23, 2024 23:10
@jar-stripe jar-stripe requested review from helenye-stripe and removed request for a team October 23, 2024 23:10
@jar-stripe jar-stripe changed the title Fix empty resources for service groupings Remove empty resources created for service groupings Oct 23, 2024
@helenye-stripe
Copy link
Contributor

Can we rebase this off of master to remove the non-related changes? Other than that 👍

@jar-stripe
Copy link
Contributor Author

Can we rebase this off of master to remove the non-related changes? Other than that 👍

Done! But this includes a file that shouldn't be there (Margins.d.ts) and will continue to generate until we update the openapi version, so I think this probably needs to wait until that is resolved before we merge.

@jar-stripe jar-stripe enabled auto-merge (squash) November 4, 2024 20:14
@jar-stripe jar-stripe merged commit d12717a into master Nov 5, 2024
9 checks passed
@jar-stripe jar-stripe deleted the jar/fix-naming-discrepancies branch November 5, 2024 00:11
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