Skip to content

Add constants for release train / major version (and probably minor as well) #2001

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

Open
dan-lind opened this issue May 16, 2025 · 1 comment

Comments

@dan-lind
Copy link

Is your feature request related to a problem? Please describe.

Today we can get the current SDK API version by calling Stripe.API_VERSION
This is defined as a static final string, which resolves to something like 2025-04-30.basil

When comparing messages passed between different services that might be on different versions of the SDK, it's important to understand if they are on different release trains, since the versioning contract states that breaking changes are only introduced for new majors.

To get the release train/major version, we have to do something like
Stripe.API_VERSION.split("\\.", 2)[1]
It would be nice if Stripe provided constants for major/release train (and probably minor version as well)

Describe the solution you'd like

Add a new constants in Stripe.java
With Stripe.API_VERSION returning 2025-04-30.basil

Something like
Stripe.API_RELEASE_TRAIN which returns the release train/major version basil
or simply
Stripe.API_MAJOR_VERSION which returns basil and
Stripe.API_MINOR_VERSION which returns 2025-04-30
to avoid forcing users to do string parsing

Describe alternatives you've considered

No response

Additional context

No response

@xavdid-stripe
Copy link
Member

Hey @dan-lind! That's a great suggestion- we'll look into adding it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants